I embraced continuous integration many years ago for purely selfish reasons, but it did not take long to see the real value of the process. I happened to work on a team where developers continually forgot to check in all of their work. Being an early morning person, I would be the first one to sync out the previous days changes; at least once a week, my work area would be unbuildable because of missing files. I would end up wasting time mocking up an object or figuring out how to work around the problem.
Enter Cruise Control. I originally setup the tool for notification purposes, cruise would monitor the CVS repository for changes and kick off the build script after each check in. If the build failed, anyone who made changes since the last successful build will be notified of the failure via email. To ensure that the developers would fix the problem, we enabled the spam feature. Cruise would continue to attempt building the project until it was successful. This could result in numerous email messages per hour, and was usually a pretty good motivator to fix the problem. We actually had to institute a higher level of encouragement on some projects, the “Bagel Rule”. If you were responsible for breaking the build for over 24 hours, you had to bring in bagels for the team. This rule worked wonders!
Once the developers got used to the process, we started to crank up the expectations. We could use Cruise to improve the quality of our code, enabling tools like Checkstyle and PMD. If the code did not conform to our standards or was overly complex, the build was marked as a failure. These tools essentially automated a basic code review process. They did not guarantee a good design, but did a pretty good job at ensuring that the code was well structured and maintainable. The most valuable Cruise integration was the addition of jUnit and Clover. By executing the jUnit suite after each check in, helped us discover any unintended sided effects induced by the changes. By combining the execution of the jUnit suite with code coverage data (we happened to use Clover), gave us a quantitative value of the confidence that we could place on our code. If we had low code coverage, it was impossible to have high confidence in our code’s correctness, or even in our ability to refactor the code and ensure that that it still worked. Conversely, if we had a decent quality jUnit suite and a high code coverage percentage, then we felt pretty good about the correctness o the code base and had complete confidence in our ability to refactor.
Cruise Control has been around for quite a few years and is now a very mature tool. This is one of those areas that I have not recently researched, but was surprised by how many options are now available to development teams. Cruise Control is fairly easy to setup and does exactly what it needs to do, from an continuous integration perspective. However, it does not provide that same amount of information and value that other tools appear to provide. From a commercial product perspective, I would really like to evaluate the Bamboo tool from Atlassian. I have been throughly impressed with the Atlassian product suite. I think they really understand what developers need and how they work. My favorite open source product is Hudson. It seems to have some pretty big supporters, such as JBoss QA (Check out the link, pretty cool). What makes Hudson interesting is the plug-in infrastructure and the trending aspects. It is very easy to integrate and publish a variety of metrics in the Hudson dashboard, something that Cruise Control does not do very well at all. The dashboard gives you a good feeling of the projects health and stability. Hudson keeps a history of metrics, and displays how the project has evolved over time. Pretty cool, if you are interesting in continuously improving your code base; it gives the developers a dynamic picture of their effort. Configurability is probably one of Hudson’s greatest strengths, more on that later.
What are your experiences? Just like unit testing, I would not want to develop without my continuous integration safety net!