Continuous integration
From Wikipedia, the free encyclopedia
This article may require cleanup to meet Wikipedia's quality standards. Please improve this article if you can. (March 2008) |
This article requires authentication or verification by an expert. Please assist in recruiting an expert or improve this article yourself. See the talk page for details. This article has been tagged since March 2008. |
Continuous integration describes a set of software engineering practices that speed up the delivery of software by decreasing integration times. It 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] 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.
[edit] The Practices
Although these practices existed before, extreme programming practitioners recommend that teams require their developers to continuously integrate.
[edit] 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.
[edit] 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).
[edit] 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.
[edit] 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.
[edit] 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, some prefer 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.
[edit] Keep the build fast
The build needs to be fast, so that if there is a problem with integration, it is quickly identified.
[edit] 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.
[edit] 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.
[edit] 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.
[edit] Automate Deployment
[edit] 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.
[edit] Software
Notable examples of continuous integration software include:
- AnthillPro — a continuous integration server from Urbancode
- 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
- Build Forge — IBM Rational Software's adaptive framework to standardize and automate build and release processes
- CABIE — Continuous Automated Build and Integration Environment. Open source, written in Perl, works with CVS, Subversion and Perforce.
- CruiseControl — Java-based framework for a continuous build process
- CruiseControl.NET — .NET-based automated continuous integration server
- CruiseControl.rb — for Ruby and Rails applications
- Electric Commander — a continuous integration server by Electric Cloud
- FinalBuilder Server — commercial automated build and continuous integration server by VSoft Technologies
- Hudson — MIT licensed, written in Java, runs in servlet container, supports CVS, Subversion, Ant, NAnt, Maven, and shell scripts
- OpenMake Meister — CI Builds with Continuous Build Scripts and Build Avoidance by OpenMake Software.
- OpenMake Mojo — freeware continuous integration server, written as an Eclipse RCP plugin
- Parabuild — a commercial Continuous integration and release management system from Viewtier
- Pulse — a commercial Continuous integration system from Zutubi
- Rephlux — a continuous integration tool for PHP, built as part of the Web Application Component Toolkit
- TeamCity — a continuous integration by JetBrains
- Team Foundation Server - Microsoft's commercial continuous integration server and source code repository
- Tinderbox — a Mozilla based product written in Perl
- Xinc — a continuous integration server written in PHP 5.
- 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.
[edit] See also
[edit] Further reading
- Duvall, Paul M. (2007). Continuous Integration. Improving Software Quality and Reducing Risk. Addison-Wesley. 0-321-33638-0.
[edit] References
- ^ FOWLER, Martin. Continuous Integration.
[edit] External links
- Continuous integration by Martin Fowler (an introduction)
- Continuous Integration at the Portland Pattern Repository (a collegial discussion)
- Cross platform testing at the Portland Pattern Repository
- Continuous Integration Server Feature Matrix (a guide to tools)
- Continuous Integration: The Cornerstone of a Great Shop by Jared Richardson (an introduction)
- A Recipe for Build Maintainability and Reusability by Jay Flowers
- Continuous Integration anti-patterns by Paul Duvall
- Extreme programming