Monday, September 13, 2010

test-driven development

howdy,

test driven development in a quickie..
development:
1. read use case.
2. identify domain models and services
3. make test for services and domain models
4. run test, should fail.
5. now implement something. run tests again.
6. if fail, refactor. if pass, move to next use case.
7. rinse and repeat.

bug-fixing:
1. read bug description.
2. make a test to make the bug appear and have it fail.
3. fix the bug. run test to pass.
4. run other tests to check if you have broken something.
5. if nothing is broken. commit. move to next bug.
6. rinse and repeat.

continuous integration:
1. have at least #1 above. if not, do that first.
2. write test suites for all tests. group them by module.
3. have a script to trigger all test suites.
4. build, run tests, notify, package, deploy.

:)

Thursday, December 11, 2008

Linux Makes Me Feel Better

I have just made my switch from Windows to Ubuntu Hardy Heron release. I freed some 10GB space from my workstation here in the office. And installed the little critter from the cd.

With all the talk about Linux and talking about every couple of months a new Linux distro gets upgraded and released, I figured why shouldn't I try it out. I have been using Linux (Red Hat) sparingly just couple of years ago. But I was frustrated how hard it is (the command line and stuff) due to coming from a GUI environment such as Windows. But still my hopes were high.

I read a couple of basic tutorials for both Unix and Linux and what scares me that time is the huge amount of things that needs to be known first : compiling/installing from source, changing permissions, changing ownership, etc just to run a couple of applications.

To counter my frustration, I learned about how to simply compile a program, and read a few C/C++ tutorials. I regretted my college days of ignoring programing subjects just to play PC games. I said these are only for geeks. But what it turns out is that I became more and more obsessed about programming and os/system administration.

I want to take my simple techie knowledge to the next level. Starting with Windows, I changed my settings not from the GUI perspective but by tweaking the registry. But to no avail, sometimes I really messed it up. Then comes system restore to the rescue. And a moment later, I have to re-install the whole darn Windows machine!

In search for salvation, I have stumbled upon the likes of Eric aka Tweakhound. I'm glad there are guys like Eric with such profound Windows tutorials. I became more careful with Windows registry and borrowed a couple of registry tweaks to speed up the Windows PC. And also thanks to Eric, I have felt the importance of a Forum, a mean but helpful community forum.

From those forums led me to some Linux sites. And like a flash of light, Ubuntu. I started to crawl up on the features. The first I had looked for is how to install stuff : the Synaptic Manager. Wow it seems impressive. I quickly downloaded my first Linux distro (all my own) Kubuntu 7.04.

I am really not familiar with installing Linux. So at first try I really messed up the boot record. Sheesh. With a couple of tries and some tutorials, it finally was like a dance in the rain! Finally a KDE desktop mightier than the looks of XP. But from a couple of clicks, it seems so slow. No matter, the eye candy sure is a drag. But hey look no more AV stuff! Every action goes through me (system settings need a password to be able to be changed).

From here on, I indulged myself more and more not only Linux but the free and open-source software as well. I still use Windows because of job requirements. The good part is that I am no longer alienated to other kinds systems especially Linux/Unix.

I have also tried Unix -- *-BSD distros. But the command line is still not good for me. There is one distro based on FreeBSD : PCBSD. Looks good but I still consider KDE a drag, for me Gnome is better and feels snappy.

So came Hardy Heron packed with built in compiz for Gnome/KDE eye candy. And installing applications is a one-stop shop like never before. And it is fun to see that from this crazy and fast-paced world of software revolution, there are alternatives to my faved software from Windows like text editors, grafx software, office applications, etc.

Ease of use inside a Linux desktop is still young but it is not impossible. Thanks to the open source movement soon we have a desktop that is 100% Free, with applications that are free, and a choice of not wasting cents for commerical software that are marketed as best, but are so dumb in the long run.

Friday, November 14, 2008

Maven, Spring, Hibernate and Eclipse - kick-ass Java development

Using Maven as a build and project management tool with automatic dependency management, building Java web applications had never been this easy. Put in Spring for separation of concerns and Hibernate for a bad-ass Object Relational Mapping, the only thing that I am concerned about is the business logic and requirements of the application.

We have been idle for at most two weeks now. Everybody is concerned of what other things to do since our project had come to an end. Well, for me I had been studying Maven with Spring and Hibernate integration. I spent one whole week just understanding Spring and Hibernate basics and another few days for Maven.

Java developers had been talking about how easy it is to develop with Maven with its automatic dependency management and a set of best practices for project architecture and management. Ok I think I should give it a try. The first day was blunt. But I persevered. Thanks to my experience with Ant I had some light following the tutorials and the documentations of Maven. And when the first time I ran Maven inside Eclipse and seeing some info logged in the console, I was amazed. It seems Maven is downloading every ounce of necessary dependencies for a given project and putting those dependencies (jars + pom) on my local repository the first time. That's cool. What's more every Maven project follows the same project architecture. I think you would never be lost if you moved from one Maven project archetype to another.

Second was Spring. Learning it, I never had a hard time to be concerned with best practices. It was a marvel idea from Rod Johnson and the Spring community. Convention over configuration or vice versa, Spring handles it without even tieing up with application itself. Sweet.

The last one is Hibernate. Suits well for new projects and projects that rely on straightforward SQL queries. I haven't investigated running under stored procedures though. Hibernate's strength lies on its ORM and database management. All I worry now is my business classes after setting up the mappings.

The good thing is, Spring supports Hibernate well and gives me a decent MVC architecture. Another best thing is that Maven handles all of them. With plugins for all of these frameworks and build tools inside Eclipse (the best IDE for me) J2EE development is easy.

Well, that's it for now. Spring, Hibernate, Maven, and Eclipse--one of the best development tools for Java Enterprise.

Sunday, November 2, 2008

Hello world!

I came in late this afternoon and our project had been scrapped. Oh well, my yahoo messenger status really depicts what I am in now... On Vacation!

On the other side, Google AppEngine really rocks! It is so easy to develop a web application provided you know how to program in Python. Anyhow, Python is also not that hard to learn.
You can learn Python in just a few days.

Wednesday, October 15, 2008

Ready, Aim, Fire!

My very first post for this blog. I have created numerous other blogs but none of them last that long. Here in this new blog I will be posting not only geek stuff but also my personal experiences. I will make my blog all-in-one. :)

But because I am a techie person so most will be geek stuff. :) Some will be about life-changing experiences, romance, drama, comedy, you name it!

So on with the show...

Yesterday, I stumbled upon delicious.com which is an online bookmarking system that can be shared with other users. Your bookmarks are online so you don't need to import/export when working with multiple browsers. I think it is pretty neat. In addition because the bookmarking system is not about creating folders but about creating tags. Simply it is a blog of bookmarks and arranged using tags!

The other site is digg.com . This one works and generates content from user contribution, let's say news, videos, blogs, your new website, etc. And after you post any of these stuff, other users can vote or digg for it. The hottest topic will featured on the home page! Pretty neat!

So much for geek stuff.