Continuous integration
Encyclopedia
In software engineering
Software engineering
Software Engineering is the application of a systematic, disciplined, quantifiable approach to the development, operation, and maintenance of software, and the study of these approaches; that is, the application of engineering to software...

, continuous integration (CI) implements continuous processes of applying quality control
Quality control
Quality control, or QC for short, is a process by which entities review the quality of all factors involved in production. This approach places an emphasis on three aspects:...

 — small pieces of effort, applied frequently. Continuous integration aims to improve the quality of software
Software quality
In the context of software engineering, software quality refers to two related but distinct notions that exist wherever quality is defined in a business context:...

, and to reduce the time taken to deliver it, by replacing the traditional practice of applying quality control after completing all development.

Theory

When embarking on a change, a developer takes a copy of the current code base on which to work. As other developers submit changed code to the source code repository, this copy gradually ceases to reflect the repository code. When developers submit 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 the repository contains, the more work developers must do before submitting their own changes.

Eventually, the repository may become so different from the developers' baselines that they enter what is sometimes called "integration hell",
where the time it takes to integrate exceeds the time it took to make their original changes. In a worst-case scenario, developers may have to discard their changes and completely redo the work.

Continuous integration involves integrating early and often, so as to avoid the pitfalls of "integration hell". The practice aims to reduce rework and thus reduce cost and time.

There is an opposing theory/method of CI: Before submitting work, each programmer must do a complete build and test. All programmers should start the day by updating the project from the repository. That way, they will all stay up-to-date.

The rest of this article discusses best practice
Best practice
A best practice is a method or technique that has consistently shown results superior to those achieved with other means, and that is used as a benchmark...

 in how to achieve continuous integration, and how to automate this practice. Automation
Automation
Automation is the use of control systems and information technologies to reduce the need for human work in the production of goods and services. In the scope of industrialization, automation is a step beyond mechanization...

 is a best practice itself.

Principles of continuous integration

Continuous integration – the practice of frequently integrating one's new or changed code with the existing code repository – should occur frequently enough that no intervening window remains between commit and build, and such that no errors can arise without developers noticing them and correcting them immediately. Normal practice is to trigger these builds by every commit to a repository, rather than a periodically 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
CruiseControl
In software development, CruiseControl is a Java-based framework for a continuous build process. It includes, but is not limited to, plugins for email notification, Ant, and various source control tools. A web interface is provided to view the details of the current and previous builds...

, Jenkins
Jenkins (software)
Jenkins, previously known as Hudson, is an open source continuous integration tool written in Java. The project renamed itself after a dispute with Oracle who claims the right to trademark the Hudson name and has applied for such a trademark as of December 2010...

, Hudson
Hudson (software)
Hudson is a continuous integration tool written in Java, which runs in a servlet container, such as Apache Tomcat or the GlassFish application server. It supports SCM tools including CVS, Subversion, Git and Clearcase and can execute Apache Ant and Apache Maven based projects, as well as arbitrary...

, BuildMaster
BuildMaster
BuildMaster is an integratedbuild, release, and application lifecycle management system that provides automation of the software development build, test, and deployment processes....

, or Teamcity
TeamCity
TeamCity is a Java-based build management and continuous integration server from JetBrains, creators of IntelliJ IDEA and ReSharper.It was first released on October 2, 2006.-Notable Features:...

 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.

To achieve these objectives, continuous integration relies on the following principles.

Maintain a code repository

This practice advocates the use of a revision control
Revision control
Revision control, also known as version control and source control , is the management of changes to documents, programs, and other information stored as computer files. It is most commonly used in software development, where a team of people may change the same files...

 system for the project's source code. All artifacts required to build the project should be placed in the repository. In this practice and in the revision control
Revision control
Revision control, also known as version control and source control , is the management of changes to documents, programs, and other information stored as computer files. It is most commonly used in software development, where a team of people may change the same files...

 community, the convention is that the system should be buildable from a fresh checkout and not require additional dependencies. Extreme Programming
Extreme Programming
Extreme programming is a software development methodology which is intended to improve software quality and responsiveness to changing customer requirements...

 advocate Martin Fowler
Martin Fowler
-Online presentations:* at RailsConf 2006* at JAOO 2006* at QCon London 2007 * at QCon London 2008 * at ThoughtWorks Quarterly Technology Briefing, October 2008...

 also mentions that where branching
Branching (software)
Branching, in revision control and software configuration management, is the duplication of an object under revision control so that modifications can happen in parallel along both branches....

 is supported by tools, its use should be minimized. Instead, it is preferred that changes are integrated rather than creating multiple versions of the software that are maintained simultaneously. The mainline (or trunk
Trunk (software)
In the field of software development, trunk refers to the unnamed branch of a file tree under revision control. The trunk is usually meant to be the base of a project on which development progresses. If developers are working exclusively on the trunk, it always contains the latest cutting-edge...

) should be the place for the working version of the software.

Automate the build

A single command should have the capability of building the system. Many build-tools, such as make, have existed for many years. Other more recent tools like Ant
Apache Ant
Apache Ant is a software tool for automating software build processes. It is similar to Make but is implemented using the Java language, requires the Java platform, and is best suited to building Java projects....

, Maven
Apache Maven
Maven is a build automation and software comprehension tool. While primarily used for Java programming, it can also be used to build and manage projects written in C#, Ruby, Scala, and other languages. Maven serves a similar purpose to the Apache Ant tool, but it is based on different concepts and...

, MSBuild
MSBuild
MSBuild is a Microsoft build platform typically used in conjunction with Visual Studio. MSBuild version 2.0 is part of .NET Framework 2.0 and works together with Visual Studio 2005...

, OpenMake Meister or IBM Rational Build Forge are frequently used in continuous integration environments. Automation of the build
Build Automation
Build automation is the act of scripting or automating a wide variety of tasks that software developers do in their day-to-day activities including things like:* compiling computer source code into binary code* packaging binary code* running tests...

 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
RPM Package Manager
RPM Package Manager is a package management system. The name RPM variously refers to the .rpm file format, files in this format, software packaged in such files, and the package manager itself...

 or DEB
Deb (file format)
deb is the extension of the Debian software package format and the most often used name for such binary packages. Like the "Deb" part of the term Debian, it originates from the name of Debra, erstwhile girlfriend and now ex-wife of Debian's founder Ian Murdock.Debian packages are also used in...

 files).

Make the build self-testing

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

Everyone commits to the baseline 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 resolve. Early, small conflicts in an area of the system cause team members to communicate about the change they are making.

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

Every commit (to baseline) should be built

The system should build commits to the current working version in order to verify that they integrate 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
Daemon (computer software)
In Unix and other multitasking computer operating systems, a daemon is a computer program that runs as a background process, rather than being under the direct control of an interactive user...

 monitors the version control system for changes, then automatically runs the build process.

Keep the build fast

The build needs to complete rapidly, 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 deploy in the production environment, because the production environment may differ from the test environment in a significant way. However, building a replica of a production environment is cost prohibitive. Instead, the pre-production environment should be built to be a scalable version of the actual production environment to both alleviate costs while maintaining technology stack
Technology stack
A technology stack comprises the layers of components or services that are used to provide a software solution or application. Traditional examples include the OSI seven-layer model, the TCP/IP model, and the ....

 composition and nuances.

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 errors 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 breaks and, if so, who made the relevant change.

Automate deployment

Most CI systems allow the running of scripts after a build finishes. In most situations, it is possible to write a script to deploy the application to a live test server that everyone can look at. A further advance in this way of thinking is Continuous Deployment, which calls for the software to be deployed directly into production, often with additional automation to prevent defects or regressions.

History

Continuous Integration emerged in the Extreme Programming
Extreme Programming
Extreme programming is a software development methodology which is intended to improve software quality and responsiveness to changing customer requirements...

 (XP) community, and XP advocates Martin Fowler
Martin Fowler
-Online presentations:* at RailsConf 2006* at JAOO 2006* at QCon London 2007 * at QCon London 2008 * at ThoughtWorks Quarterly Technology Briefing, October 2008...

 and Kent Beck
Kent Beck
Kent Beck is an American software engineer and the creator of the Extreme Programming and Test Driven Development software development methodologies. Beck was one of the 17 original signatories of the Agile Manifesto in 2001....

 first wrote about continuous integration circa 1999. Fowler's paper is a popular source of information on the subject. Beck's book Extreme Programming Explained, the original reference for Extreme Programming
Extreme Programming
Extreme programming is a software development methodology which is intended to improve software quality and responsiveness to changing customer requirements...

, also describes the term.

Advantages

Continuous integration has many advantages:
  • when unit tests fail or a bug
    Software bug
    A software bug is the common term used to describe an error, flaw, mistake, failure, or fault in a computer program or system that produces an incorrect or unexpected result, or causes it to behave in unintended ways. Most bugs arise from mistakes and errors made by people in either a program's...

     emerges, developers might revert the codebase to a bug-free state, without wasting time debugging
    Debugging
    Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a computer program or a piece of electronic hardware, thus making it behave as expected. Debugging tends to be harder when various subsystems are tightly coupled, as changes in one may cause bugs to emerge...

  • developers detect and fix integration problems continuously - avoiding last-minute chaos at release dates, (when everyone tries to check in their slightly incompatible versions).
  • 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
  • metrics generated from automated testing and CI (such as metrics for code coverage, code complexity, and features complete) focus developers on developing functional, quality code, and help develop momentum in a team

Disadvantages

  • initial setup time required
  • well-developed test-suite required to achieve automated testing advantages
  • hardware costs for build machines can be significant


Many teams using CI report that the advantages of CI well outweigh the disadvantages.
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

Software tools for continuous integration include:
  • AnthillPro
    AnthillPro
    AnthillPro is a continuous integration server from Urbancode.Released in 2001, AnthillPro is one of the original Continuous Integration servers. Currently in its third generation, it supports distributed as well as cross-platform builds in .Net, Java, C/C++ and other languages...

    : continuous integration server by Urbancode
  • Apache Continuum
    Apache Continuum
    Apache Continuum, a partner to Apache Maven, is a continuous integration server, which runs builds on a configurable schedule. Much like CruiseControl, Continuum emails developers when the build is broken, requesting that the culprit fix the problem...

    : continuous integration server supporting Apache Maven
    Apache Maven
    Maven is a build automation and software comprehension tool. While primarily used for Java programming, it can also be used to build and manage projects written in C#, Ruby, Scala, and other languages. Maven serves a similar purpose to the Apache Ant tool, but it is based on different concepts and...

     and Apache Ant
    Apache Ant
    Apache Ant is a software tool for automating software build processes. It is similar to Make but is implemented using the Java language, requires the Java platform, and is best suited to building Java projects....

  • Apache Gump
    Apache Gump
    Apache Gump is an open source continuous integration system, which aims to build and test all the open source Java projects, every night. Its aim is to make sure that all the projects are compatible, at both the API level and in terms of functionality matching specifications...

    : continuous integration tool by Apache
    Apache Software Foundation
    The Apache Software Foundation is a non-profit corporation to support Apache software projects, including the Apache HTTP Server. The ASF was formed from the Apache Group and incorporated in Delaware, U.S., in June 1999.The Apache Software Foundation is a decentralized community of developers...

  • Automated Build Studio: proprietary automated build, continuous integration and release management system by AutomatedQA
  • Bamboo
    Bamboo (software)
    Bamboo is a continuous integration server from Atlassian, the makers of JIRA, Confluence and Crowd.Bamboo is free for philanthropic and open-source projects. Commercial organizations are charged based on the number of build agents needed...

    : proprietary continuous integration server by Atlassian Software Systems
  • Bitten Automated Build: continuous build plugin for Trac
    Trac
    Trac is an open source, web-based project management and bug-tracking tool. The program is inspired by CVSTrac, and was originally named svntrac due to its ability to interface with Subversion. It is developed and maintained by Edgewall Software....

  • BuildBot
    BuildBot
    BuildBot is a software development continuous integration tool which automates the compile/test cycle required to validate changes to the project code base...

    : Python
    Python (programming language)
    Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...

     / Twisted
    Twisted (software)
    Twisted is an event-driven network programming framework written in Python and licensed under the MIT License.Twisted projects variously support TCP, UDP, SSL/TLS, IP Multicast, Unix domain sockets, a large number of protocols , and much more...

    -based continuous build system
  • BuildMaster
    BuildMaster
    BuildMaster is an integratedbuild, release, and application lifecycle management system that provides automation of the software development build, test, and deployment processes....

    : proprietary application lifecycle management
    Application lifecycle management
    Application Lifecycle Management is a continuous process of managing the life of an application through governance, development and maintenance...

     and continuous integration tool by Inedo
  • CABIE
    CABIE
    CABIE, or the Continuous Automated Build and Integration Environment, is a multi-platform, multi-revision control system, client/server-based application providing both command line and Web-based access to real time build monitoring and execution information. CABIE runs as a daemon on Linux,...

    : Continuous Automated Build and Integration Environment: open source, written in Perl
    Perl
    Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions and become widely popular...

  • Cascade
    Cascade (software)
    Cascade is a proprietary software configuration management tool suite developed by Conifer Systems LLC. It includes:* Cascade File System, a file system driver that exposes a Subversion or Perforce repository as a modifiable directory tree in the user's file system.* Cascade Proxy, a proxy server...

    : proprietary continuous integration tool
  • codeBeamer
    CodeBeamer (software)
    codeBeamer is a web based Collaborative Application Lifecycle Management tool for distributed software development, written in Java. It is developed and marketed by Intland Software. Its license is proprietary, but free versions and free hosting options are available...

    : proprietary collaboration software with built-in continuous integration features
  • CruiseControl
    CruiseControl
    In software development, CruiseControl is a Java-based framework for a continuous build process. It includes, but is not limited to, plugins for email notification, Ant, and various source control tools. A web interface is provided to view the details of the current and previous builds...

    : Java
    Java (programming language)
    Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

    -based framework for a continuous build process
  • CruiseControl.NET: .NET
    .NET Framework
    The .NET Framework is a software framework that runs primarily on Microsoft Windows. It includes a large library and supports several programming languages which allows language interoperability...

    -based automated continuous integration server
  • CruiseControl.rb
    CruiseControl.rb
    In software development, CruiseControl.rb is a Ruby-based framework for a continuous build process. It allows one to perform a continuous integration of a codebase in any language and on any platform....

    : Lightweight, Ruby
    Ruby (programming language)
    Ruby is a dynamic, reflective, general-purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features. Ruby originated in Japan during the mid-1990s and was first developed and designed by Yukihiro "Matz" Matsumoto...

    -based continuous integration server that can build any codebase, not only Ruby, released under Apache Licence 2.0
  • ElectricCommander
    Electric Cloud
    Electric Cloud, Inc. is a privately held software corporation specializing in high-performance software build tools. Electric Cloud is based in Sunnyvale, California and currently offers two products. The first product, ElectricAccelerator, speeds up make, Microsoft Visual Studio, and Apache Ant...

    : proprietary continuous integration and release management solution from Electric Cloud
  • FinalBuilder
    FinalBuilder
    FinalBuilder is an integrated tool for carrying out software builds on the Windows platform. Unlike tools such as make or Apache Ant, which require separate tools for authoring, executing and carrying out individual steps, FinalBuilder provides a unified graphical interface to author and execute...

     Server: proprietary automated build and continuous integration server by VSoft Technologies
    VSoft Technologies
    VSoft Technologies is a Canberra-based ISV , established in 1997. VSoft Technologies produces automated build and administrative automation software for the Windows platform.-External links:**...

  • Go
    Go (software)
    Go is a proprietary continuous integration and release management product by ThoughtWorks Studios. It is a part of the Adaptive ALM solution by ThoughtWorks Studios- History:...

    : proprietary agile build and release management software by Thoughtworks
    ThoughtWorks
    ThoughtWorks is a privately owned global IT consultancy that delivers custom software, software tools, consulting, and transformation services to Global 1000 companies. It has a products division, ThoughtWorks Studios, which creates and markets software development and project management applications...

  • Hudson
    Hudson (software)
    Hudson is a continuous integration tool written in Java, which runs in a servlet container, such as Apache Tomcat or the GlassFish application server. It supports SCM tools including CVS, Subversion, Git and Clearcase and can execute Apache Ant and Apache Maven based projects, as well as arbitrary...

    ; MIT-licensed
    MIT License
    The MIT License is a free software license originating at the Massachusetts Institute of Technology . It is a permissive license, meaning that it permits reuse within proprietary software provided all copies of the licensed software include a copy of the MIT License terms...

    , written in Java
  • Jenkins
    Jenkins (software)
    Jenkins, previously known as Hudson, is an open source continuous integration tool written in Java. The project renamed itself after a dispute with Oracle who claims the right to trademark the Hudson name and has applied for such a trademark as of December 2010...

    : (split from Hudson
    Hudson (software)
    Hudson is a continuous integration tool written in Java, which runs in a servlet container, such as Apache Tomcat or the GlassFish application server. It supports SCM tools including CVS, Subversion, Git and Clearcase and can execute Apache Ant and Apache Maven based projects, as well as arbitrary...

    ); MIT-licensed
    MIT License
    The MIT License is a free software license originating at the Massachusetts Institute of Technology . It is a permissive license, meaning that it permits reuse within proprietary software provided all copies of the licensed software include a copy of the MIT License terms...

    , written in Java
  • Pulse
    Pulse (software)
    Pulse is an app for Android and the iPad tablet computer, released in 2010. The application, which displays news from multiple RSS feeds in a single page, was temporarily removed from the App Store on June 8, 2010, hours after it was praised by Apple Inc. founder Steve Jobs at WWDC 2010, when The...

    : proprietary continuous integration server by Zutubi
  • Rational Team Concert: proprietary software development collaboration platform with built-in build engine by IBM
    IBM
    International Business Machines Corporation or IBM is an American multinational technology and consulting corporation headquartered in Armonk, New York, United States. IBM manufactures and sells computer hardware and software, and it offers infrastructure, hosting and consulting services in areas...

  • SCLM: software configuration management system for z/OS
    Z/OS
    z/OS is a 64-bit operating system for mainframe computers, produced by IBM. It derives from and is the successor to OS/390, which in turn followed a string of MVS versions.Starting with earliest:*OS/VS2 Release 2 through Release 3.8...

     by IBM
    IBM
    International Business Machines Corporation or IBM is an American multinational technology and consulting corporation headquartered in Armonk, New York, United States. IBM manufactures and sells computer hardware and software, and it offers infrastructure, hosting and consulting services in areas...

     Rational Software
    Rational Software
    Rational Machines was founded by Paul Levy and Mike Devlin in 1981 to provide tools to expand the use of modern software engineering practices, particularly explicit modular architecture and iterative development...

  • TeamCity
    TeamCity
    TeamCity is a Java-based build management and continuous integration server from JetBrains, creators of IntelliJ IDEA and ReSharper.It was first released on October 2, 2006.-Notable Features:...

    : proprietary continuous-integration server by JetBrains
    JetBrains
    JetBrains is a Czech software development company with offices in Prague, Czech Republic; Saint Petersburg, Russia; Boston, USA and Munich, Germany...

     with free professional edition
  • Team Foundation Server
    Team Foundation Server
    Team Foundation Server is a Microsoft product offering source control, data collection, reporting, and project tracking, and is intended for collaborative software development projects...

    : proprietary continuous integration server and source code repository by Microsoft
    Microsoft
    Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...

  • Tinderbox
    Tinderbox (software)
    Tinderbox is a software suite that provides continuous integration capability. Tinderbox allows developers to manage software builds and to correlate build failures on various platforms and configurations with particular code changes....

    : Mozilla
    Mozilla
    Mozilla is a term used in a number of ways in relation to the Mozilla.org project and the Mozilla Foundation, their defunct commercial predecessor Netscape Communications Corporation, and their related application software....

    -based product written in Perl

See also

  • Build light indicator
    Build light indicator
    A build light indicator is a simple visual indicator used in Agile software development to inform a team of software developers about the current status of their project...

  • Build automation
    Build Automation
    Build automation is the act of scripting or automating a wide variety of tasks that software developers do in their day-to-day activities including things like:* compiling computer source code into binary code* packaging binary code* running tests...

  • Continuous design
    Continuous design
    Continuous design is a software development practice of creating and modifying the design of a system as it is developed, rather than specifying the system completely before development starts, or in bursts at the beginning of each iteration...

  • Test-driven development
    Test-driven development
    Test-driven development is a software development process that relies on the repetition of a very short development cycle: first the developer writes a failing automated test case that defines a desired improvement or new function, then produces code to pass that test and finally refactors the new...

  • Multi-stage continuous integration
    Multi-stage continuous integration
    Multi-Stage Continuous integration allows for a high degree of integration to occur in parallel while vastly reducing the scope of integration problems...

  • Comparisons of continuous-integration software
    Comparison of Continuous Integration Software
    - About Continuous Integration Software :Continuous integration describes a set of software engineering practices that speed up the delivery of software by decreasing integration times. Software that accomplish this practice is called continuous integration software.- Comparison :...


External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK