Practice: Continuous Integration
Continuous integration is a practice where each team member integrates his or her work frequently (at least daily).
Relationships
Description
Purpose

The effort required to integrate a system increases exponentially with time.  By integrating the system more frequently, integration issues are identified earlier when they are easier to fix and the overall integration effort is reduced.  The result is a higher quality product and more predictable delivery schedules.

Continuous integration provides the following benefits:

  1. Improved feedback. Continuous integration shows constant and demonstrable progress.
  2. Improved error detection. Continuous integration enables you to detect and address errors early, often minutes after they’ve been injected into the product. Effective continuous integration requires automated unit testing with appropriate code coverage.
  3. Improved collaboration. Continuous integration enables team members to work together safely. They know that they can make a change to their code, integrate the system, and determine very quickly whether or not their change conflicts with others.
  4. Improved system integration. By integrating continuously throughout your project you know that you can actually build the system, thereby mitigating integration surprises at the end of the lifecycle.
  5. Reduced number of parallel changes that need to be merged and tested.
  6. Reduced number of errors found during system testing. All conflicts are resolved prior to making new change sets available, by the person who is in the best position to resolve them.
  7. Reduced technical risk. You always have an up-to-date system against which to test.
  8. Reduced management risk. By continuously integrating your system you know exactly how much functionality that you’ve built to date, improving your ability to predict when and if you’re actually going to be able to deliver the necessary functionality.
Main Description

The Essence of Continuous Integration

The essence of continuous integration may be described by the following activities:

  1. Developers make small changes to the latest integration tested implementation in their workspace, and unit test them, prior to making the changes available to the team.
  2. Change sets from all developers are integrated in an integration workspace and tested frequently (at least daily, ideally any time a new change set is available).

The first activity ensures that changes are made to a known-good configuration and tested prior to making the changes available.  The second activity identifies integration issues early, so they can be corrected while the change is still fresh in the developers mind.

How to read this practice

The best way to read this practice is to first familiarize yourself with its overall structure -- what it is in it and how it is organized. 

Begin by reviewing the key concepts to understand the terminology used.  Then review the task Integrate and Create Build to understand what needs to be done. Finally, review the associated guidelines for more information on the overall workflow.

For step-by-step instructions on how to adopt this practice, see How to Adopt the Continuous Integration Practice.

Additional Information

Books and Articles

Martin Fowler 2006. Continuous Integration.  http://www.martinfowler.com/articles/continuousIntegration.html
Seminal paper on Continuous Integration.  Great overview of the benefits and practices of continuous integration.
Paul M. Duval with Steve Matyas and Andrew Glover 2007. Continuous Integration: Improving Software Quality and Reducing Risk. Addison-Wesley.
Comprehensive guidance on the practice, and sub-practices of continuous integration. Great overview of motivation and benefits of the practice. Detailed discussion of more than forty CI related sub-practices with example scripts and code segments. Appendix provides an overview of tools available to support the practice.