Continuous integration describes a set of software engineering practices that speed up the delivery of software by decreasing integration times.
The Practices
Although these practices existed before, extreme programming practitioners recommend that teams require their developers to continuously integrate.
Maintain a code repository
This practice advocates the use of a revision control system for the project's source code. All artifacts that are needed to build the project should be placed in the repository. In this practice and in the revision control community, the convention is that the system should be buildable from a fresh checkout and not require additional dependencies. Fowler also mentions that where branching is supported by tools, its use should be minimised. Instead, it is preferred that changes are integrated rather than creating multiple versions of the software that are maintained simultaneously. The mainline (or trunk) should be the place for the working version of the software.
Automate the build
-
The system should be buildable using a single command. Many build tools exist, such as make, which has existed for many years. Other more recent tools like Ant or MSBuild are frequently used in Continuous Integration environments. Automation of the build should include automating the integration, which often includes deployment into a production-like environment. In many cases, the build script not only compiles binaries, but also generates documentation, website pages, statistics and distribution media (such as Windows MSI files or RPM files).
Make your build self-testing
This touches on another aspect of Extreme programming: Test-driven development. The system should be written with tests that verify that it performs as intended. These tests should be run as part of the build. Automated tests are increasingly valuable as the system ages.
Everyone commits every day
By committing regularly, every committer can reduce the number of conflicting changes. Checking in weeks worth of work runs the risk of conflicting with other features and can be very difficult to solve. Early, small conflicts in an area of the system cause team members to communicate about the change they are making.
Every commit (to mainline) should be built
Commits to the current working version should be built to verify they have been integrated correctly. A common practice is to use Automated Continuous Integration, although this may be done manually. In fact, James Shore prefers this approach. For many, continuous integration is synonymous with using Automated Continuous Integration where a continuous integration server or daemon monitors the version control system for changes, then automatically runs the build process.
Keep the build fast
The build needs to be fast, so that if there is a problem with integration, it is quickly identified.
Test in a clone of the production environment
Having a test environment can lead to failures in tested systems when they are deployed to the production environment, because the production environment may differ from the test environment in a significant way.
Make it easy to get the latest deliverables
Making builds readily available to stakeholders and testers can reduce the amount of rework necessary when rebuilding a feature that doesn't meet requirements. Additionally, early testing reduces the chances that defects survive until deployment. Finding issues earlier also, in some cases, reduces the amount of work necessary to resolve them.
Everyone can see the results of the latest build
It should be easy to find out whether the build is broken and who made the change.
Automate Deployment
History
Continuous Integration emerged in the Extreme Programming (XP) community, and XP advocates Martin Fowler and Kent Beck first wrote about continuous integration near the turn of the millennium. Fowler's paper[1] (and following book[2]) is a popular source of information on the subject. Beck's book Extreme Programming Explained (1999, ISBN 0-201-61641-6), the original reference for Extreme Programming, also describes the term.
Advantages
Continuous integration has many advantages:
- When unit tests fail, or a bug is discovered, developers might revert the codebase back to a bug-free state, without wasting time debugging.
- Integration problems are detected and fixed continuously - no last minute hiatus before release dates;
- Early warning of broken/incompatible code;
- Early warning of conflicting changes;
- Immediate unit testing of all changes;
- Constant availability of a "current" build for testing, demo, or release purposes;
- The immediate impact of checking in incomplete or broken code acts as an incentive to developers to learn to work more incrementally with shorter feedback cycles.
Software
Notable examples of continuous integration software include:
- AnthillPro — a continuous integration server from Urbancode, very feature rich supports all major build related technologies
- Apache Continuum — a continuous integration server supporting Apache Maven and Apache Ant
- Apache Gump — Apache's continuous integration tool
- Atlassian Bamboo — commercial continuous integration server from Atlassian
- BuildBot — a Python/Twisted-based continuous build system
- CABIE — Continuous Automated Build and Integration Environment. Open source, written in Perl, works with CVS, Subversion, AccuRev, Bazaar and Perforce.
- Cascade — commercial continuous integration tool. Provides a "checkpointing" facility by which changes can be built and tested before they are committed.
- Cruise — Commercial continuous integration and release management server from ThoughtWorks, the creators of CruiseControl and CruiseControl.NET
- CruiseControl — Java-based framework for a continuous build process
- CruiseControl.NET — .NET-based automated continuous integration server
- CruiseControl.rb - Ruby based CI server
- Draco.NET — .NET-based automated continuous integration server inspired by CruiseControl
- ElectricCommander — commercial build-test-deploy automation solution developed by Electric Cloud
- Hudson — MIT licensed, written in Java, runs in servlet container, supports CVS, Subversion, GIT, Ant, NAnt, Maven, and shell scripts
- TeamCity — commercial continuous integration server from JetBrains with free professional edition
- Team Foundation Server - Microsoft's commercial continuous integration server and source code repository
- Tinderbox — a Mozilla based product written in Perl
- SCLM — an SCM system part of z/OS to allow integrated source control, build and promotion of work packages as a work area control system. It is part of IBM Rational Software's adaptive framework.
See also
Further reading
- Duvall, Paul M. (2007). Continuous Integration. Improving Software Quality and Reducing Risk. Addison-Wesley. 0-321-33638-0.
References
External links
|