Share on Facebook Share on Twitter Email
Answers.com

Continuous integration

 
Wikipedia: Continuous integration

Continuous integration describes a set of software engineering practices that speed up the delivery of software by decreasing integration times.

Contents

Theory

When embarking on a change, a developer takes a copy of the current code base on which to work. As changed code is submitted to the repository by other developers, this copy gradually ceases to reflect the repository code. When the developer submits code to the repository they must first update their code to reflect the changes in the repository since they took their copy. The more changes there are to the repository, the more work the developer must do before submitting their own changes.

Eventually, the repository may become so different from the developer's baseline that they enter what is sometimes called "integration hell",[1] where the time it takes to integrate is greater than the time it took to make their original changes. In a worst case scenario, the changes the developer is making may have to be discarded and the work redone.

Continuous Integration is the practice of integrating early and often, so as to avoid the pitfalls of "integration hell". The ultimate goal is to reduce timely rework and thus reduce cost and time.

The rest of this article discusses best practice in how to achieve continuous integration, and how to automate this practice (automation is considered a best practice itself).

Recommended practices

Continuous integration itself refers to the practice of frequently integrating one's new or changed code with the existing code repository. This must be carried out frequently enough that there is no intervening window between commit and build, such that errors can arise without them being noticed and corrected immediately. [2] Normal practice is to trigger these builds by every commit to a repository, rather than a nightly (or weekly!) scheduled build. The practicalities of doing this in a multi-developer environment of rapid commits are such that it's usual to trigger a short timer after each commit, then to start a build when either this timer expires, or after a rather longer interval since the last build. Automated tools such as CruiseControl or Hudson offer this scheduling automatically.

Another factor is the need for a version control system that supports atomic commits, i.e. all of a developer's changes may be seen as a single commit operation. There is no point in trying to build from only half of the changed files.

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. Extreme Programming advocate Martin 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, Maven, MSBuild or IBM Rational Build Forge 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, RPM or DEB files).

Make the build self-testing

This touches on another aspect of best practice, Test-driven development. Briefly, this is the practice of writing a test that demonstrates a lack of functionality in the system, and then writing the code that makes the test pass.

Once the code is built, all the tests should be run to confirm that it behaves as the developers expect it to behave.

Everyone commits every day

By committing regularly, every committer can reduce the number of conflicting changes. Checking in a week's 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.

Many programmers[3] recommend committing all changes at least once a day (once per feature built), and in addition performing a nightly build.

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. 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

Most CI systems will allow you to run scripts when a build is finished. In most situations, it is possible to write a script to deploy the application to a live test server that everyone can look at.

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[4] (and following book[5]) 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 and Disadvantages

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;[clarification needed]
  • 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;
  • Immediate feedback to developers on the quality, functionality, or system-wide impact of code they are writing
  • Frequent code check-in pushes developers to create modular, less complex code.[citation needed]
  • Metrics generated from automated testing and CI (such as code coverage, code complexity, features complete) focus developers on developing functional, quality code, and help develop momentum in a team.[citation needed]

Disadvantages

  • Initial setup time required
  • Well-developed test suite required for best utility

Many teams using CI report that the advantages of CI well outweigh the disadvantages.[6] The effect of finding and fixing integration bugs early in the development process saves both time and money over the lifespan of a project.

Software

Notable examples of continuous integration software include:

  • AnthillPro — continuous integration server by Urbancode
  • Apache Continuum — continuous integration server supporting Apache Maven and Apache Ant. Supports CVS, Subversion, Ant, Maven, and shell scripts
  • Apache Gump — continuous integration tool by Apache
  • Automated Build Studio — commercial automated build, continuous integration and release management system by AutomatedQA
  • Bamboo — commercial continuous integration server by Atlassian Software Systems
  • Beebox — free continuous integration server by TechSolCom IT Group
  • BittenPython/Trac-based continuous build system
  • BuildBotPython/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 to build and test changes before they are committed
  • Cerberus - lightweight, open source CI tool written in Ruby; works with CVS, Subversion, Perforce, Darcs and Git
  • codeBeamer — Commercial collaboration software with built-in continuous integration features
  • codendi - Open-source platform providing an interface with Hudson tool
  • Cruise — commercial continuous integration and release management server by ThoughtWorks
  • CruiseControlJava-based framework for a continuous build process
  • CruiseControl.NET.NET-based automated continuous integration server
  • CruiseControl.rb - Lightweight, Ruby-based continuous integration server that can build any codebase, not just Ruby. Released under the Apache Licence 2.0 licence
  • CDash - continuous integration server, part of CMake
  • ControlTier - open source (Apache license) deployment automation framework used for continuous deployment (automatic deployment at the end of the continuous integration loop)
  • Draco.NET — .NET-based automated continuous integration server inspired by CruiseControl
  • easyCIS — commercial continuous integration server by Vaclav Zahradnik
  • ElectricCommander — build/test/release automation framework and continuous integration server by Electric Cloud
  • FinalBuilder Server — commercial automated build and continuous integration server by VSoft Technologies
  • HudsonMIT licensed, written in Java, runs in servlet container, supports CVS, Subversion, Mercurial, Git, Clearcase, Ant, NAnt, Maven, and shell scripts
  • InstallAce — deployment automation software to automate installation of enterprise class applications.
  • Jhbuild is a tool used to build the whole GNOME desktop from the git source, however, it can be used to build other projects creating a moduleset for it
  • LuntBuild – a web-based tool for automating and managing builds. Runs in a Java Servlet container, and supports CVS, Subversion, Ant, Maven
  • OpenMake Meister - Commercial Build Automation tool with enhanced Continuous Integration features by OpenMake Software
  • OpenMake Mojo - Free Continuous Integration Server with workflow scheduling by OpenMake Software
  • Parabuild - commercial Continuous Integration system by Viewtier Systems
  • Pulse - commercial continuous integration server be Zutubi
  • QuickBuild - commercial version of LuntBuild by PMEase with free community edition.
  • Software Configuration and Library Manager — software configuration management system for z/OS by IBM Rational Software
  • TeamCity — commercial continuous integration server by JetBrains with free professional edition
  • Team Foundation Server — commercial continuous integration server and source code repository by Microsoft
  • TinderboxMozilla based product written in Perl

See comparison of continuous software for a more in depth feature matrix.

See also

Further reading

  • Duvall, Paul M. (2007). Continuous Integration. Improving Software Quality and Reducing Risk. Addison-Wesley. ISBN 0-321-33638-0. 

References

  1. ^ [|Cunningham, Ward] (05 Aug 2009). "Integration Hell". WikiWikiWeb. http://c2.com/cgi/wiki?IntegrationHell. Retrieved 19 Sept 2009. 
  2. ^ Fowler, Martin. "Continuous Integration". http://martinfowler.com/articles/continuousIntegration.html#PracticesOfContinuousIntegration. Retrieved 2009-11-11. 
  3. ^ Wiki:ContinuousIntegration
  4. ^ FOWLER, Martin. Continuous Integration.
  5. ^ Paul Duvall, Steve Matyas & Andrew Glover Continuous Integration: Improving Software Quality and Reducing Risk (2007, ISBN 0-321-33638-0)
  6. ^ Richardson, Jared (September 2008). "Agile Testing Strategies at No Fluff Just Stuff Conference". Boston, Massachusetts. http://www.nofluffjuststuff.com. 

External links


Search unanswered questions...
Enter a question here...
Search: All sources Community Q&A Reference topics
 
 

 

Copyrights:

Wikipedia. This article is licensed under the Creative Commons Attribution/Share-Alike License. It uses material from the Wikipedia article "Continuous integration" Read more