Jim Shore (of FIT and NUnitASP fame) says he doesn't like CruiseControl. I have to respectfully disagree on this one.
He says:
CruiseControl is a traffic cop: it doesn't help you follow the rules; it just tells you when you've broken them. If the team does their job, and never breaks the build, you'll never hear from CruiseControl. So why use it? I've seen two common reasons:
- The build does fail--often enough for CruiseControl to be valuable.
- The automated build process is too slow to wait around for.
First off, I disagree with the implication that value is wholly derived from the frequency of use. There are many things that I don't use often, but I think are highly valuable. The alarm for my home security system has never sounded, but I think the security system is still a valuable and crucial part of my home. I've rarely filed a claim on my car insurance, but I haven't cancelled it yet due to lack of use. Or, closer to home, my virus scanner runs nightly, and unless something goes wrong, I never hear from it. I haven't heard from it in months in fact....is it even worthwhile to have anymore? Yes, of course.
These analogies are obviously not perfect. I understand what Jim is saying though. If each individual of a team is truly 'doing the right thing' and writing tests (good, fast tests) first before a line of code, getting latest code and running all tests before checking in, etc, then you should rarely, if ever, experience integration problems. And yes, CruiseControl can be used as a crutch to avoid fixing inherent problems with slow tests or unstable code.
But let's not throw the baby out with the bathwater. CruiseControl is a tool that can help you identify the problems that arise when this type of development utopia fails to materialize.
Rather than a traffic cop, I prefer to think of CruiseControl as a health monitor. Every time someone checks something in, CruiseControl runs some tests, checks some reflexes, listens to the project take some deep breaths, and gives it a thumbs up or thumbs down. On the projects I've used it on, we've set it up to receive notification of the good news and the bad news. And, in this case, the check it provides becomes a palpable development rhythm. A heartbeat.
The great thing about it is that as you get a feel for the rhythm it provides, you can feel when things are not going as they should be before it reaches the state where the build is actually breaking. The team isn't checking code in as frequently as before, perhaps the project is slipping a bit. Or, the build is taking longer than it used to, perhaps some test refactoring is in order. Or, perhaps, a performance problem is getting bigger. And, when something does fail, you know immediately. Everyone does. It's the fail fast principle at it's best. What's not to like about that?