There are two ways to deal with pain: avoid it, or acclimate to it.
Integrating software into the build can be painful, exposing bugs and other issues that weren’t visible before. Many software development teams try to avoid that pain by putting integration off until as late as possible only to find that integrating their code just before release is a lot more painful. Like the woodcutter who is too busy to sharpen his saw, these teams create situations that require more effort and risk than needed.
But what if instead of putting off the pain of integration, they tried to acclimate to it? What if they work on it a little bit at a time until it becomes a series of smaller problems—each less painful?
Continuous integration is the practice of integrating software as it’s built rather than waiting until just before a release. Continuous integration is a critical practice because it not only helps eliminate bugs early but also helps developers learn how to build better code—code that can be integrated more easily. Until the feature is integrated, it’s not guaranteed to work in the system.
But continuous integration is also incredibly valuable to developers as a feedback mechanism. When the build breaks it provides so much information it’s sometimes hard to find the culprit. Broken builds must be fixed immediately, so developers don’t want feedback to be overly verbose, forcing team members to parse through log files. Developers want it made clear what’s broken so they know very quickly how to fix it.
Developers should be running continuous integration all the time and immediately seeing the results of their efforts on the system, seeing if bugs have been introduced or if their code plays well with the rest of the system.
Sophisticated tools exist to help us with continuous integration, but they all depend on working code. Compilers stop at the first error they encounter. Unit tests run against working code. Even debuggers require working code to debug. Without working code developers are confined to running programs in their imaginations, which often doesn’t match with reality.
Of all the key aspects of software development, continuous integration is the most important. It provides the framework and context for all other technical practices. Ironically, it’s also the easiest to implement.
It’s really a matter of infrastructure. All the tools needed to implement continuous integration are free and relatively simple to set up, and they provide a context for developing maintainable and extendable software.