You want to create a build system that’s so easy to use that it’s invisible to the developers on the team. It should be able to be invoked with a single click and should automatically build, test, and validate new code that’s added to the system.
Teams that are first adopting Continuous Integration sometimes ask me how often their developers should integrate their code and I say: “Tell your developers to integrate at least once a day,” but this is a little bit of a trick.
It often turns out that the last person to integrate that day ends up with a huge burden of failing tests so they wind up not getting home in time for dinner.
Instead, developers learn quickly that whenever they have even the slightest bit of functionality to add to the system they do it. By integrating code a little piece of a time, you take a very difficult problem and make it so small it’s barely noticeable. If something does go wrong, it’s easy to remedy because you know the problem was introduced between now and the last time you integrated.
The very best developers I know integrate all the time. When I look at their server logs, I see them running their tests on average of about three times a minute. This is an enormous amount of feedback they’re getting. Think about how much more successful we can be with that level of feedback coming into us all the time as we’re building a system.
Continuous Integration does require that you have the right tests and requires having a testable system, but given these things, Continuous Integration can become a cost-effective way of building and maintaining a system.
I like my builds to happen in a matter of seconds and usually, if a system is well-partitioned and architected, then the dependencies for the code I’m working on shouldn’t be huge, and the dependent unit tests can run fast.
One key to making this work is to have a well-defined dependency tree for the build. It often reflects the nature of an architecture, so cleaning up and improving the dependency tree also improves architecture.
Continuous Integration is a core prerequisite to emergent design. It’s far safer than doing emergent design with code under test. It’s valuable to write automated tests for code whose design is going to evolve.
We want to make it so that clicking the build button is so easy and uneventful we do it all the time.