“Continuous Integration (CI)” is a software engineering practice in which developers are required to regularly (at least daily) merge their code changes into a central/shared repository. Each check-in is then verified by an automated build, allowing teams to detect problems early.
Grady Booch first named and proposed CI in his 1991 method, although he did not advocate integrating several times a day. Extreme programming (XP) adopted the concept of CI and did advocate integrating code more than once per day.
CI not only could be used in Agile or Extreme Programming but traditional development approaches, such as the Waterfall model can also get benefitted from using CI methods for the construction stage.
Continuous integration software tools can be used to automate the testing and build a document trail. CI keeps the entire development team in sync, removing the delays due to integration issues. When used properly, continuous integration provides various benefits, such as constant feedback on the status of the software, as code changes are immediately tested and reported on, when they are added to a larger code base. Continuous Integration also improves Software Quality and Reduces Risk.
Continuous integration entails both an automation component (e.g. a CI or build service) and a cultural component (e.g. learning to integrate frequently).
Business benefits of Continuous Integration (CI)
Break down the barriers between customers and development: Continuous integration removes one of the biggest barriers to frequent deployment. Through frequent deployment users get new features rapidly, give more rapid feedback on those features, and generally become more collaborative in the development cycle.
Detects integration errors as quickly as possible: Continuous Integrations doesn’t get rid of bugs, but it does make it dramatically easier to find and remove them.
Typical Continuous Integration flow (it could be improved with end-to-end DevOps implementation, will be covered in my DevOps blog):
Issues with traditional Integration & Build Process: In the past, developers on a team might work in isolation for an extended period of time and only attempt to merge their changes to the master branch once their work was completed. This batched process made merging accumulated code changes difficult and time-consuming. This is compounded when small bugs accumulate for a long time without correction. These factors combined made it harder to deliver updates to customers quickly.
With continuous integration, developers frequently commit codes to a shared repository using a version control system such as Git. Prior to each commit, developers may choose to run local unit tests on their code as an extra verification layer before integrating. A continuous integration service detects commits to the shared repository, and automatically builds and runs unit tests on the new code changes to immediately surface any functional or integration errors. If necessary, partially completed features can be disabled before commit, such as by using feature toggles.
Organisations using CI typically use a build server to implement continuous processes of applying quality control like in addition to running the unit and integration tests, such processes run additional static and dynamic tests, measure and profile performance, extract and format documentation from the source code and facilitate manual QA processes (if required).
Continuous Delivery expands upon Continuous Integration by deploying all code changes to a testing environment and/or a production environment after the build stage. With continuous delivery, code changes are automatically built, tested, and prepared for a release to production. DevOps play a very important role in achieving Continuous Integration (CI) and Continuous Delivery (CD).
Practices of Continuous Integration:
- Maintain a Single Source Repository.
- Automate the Build
- Make Your Build Self-Testing
- Everyone Commits To the Mainline Every Day
- Every Commit Should Build the Mainline on an Integration Machine
- Fix Broken Builds Immediately
- Keep the Build Fast
- Test in a Clone of the Production Environment
- Make it Easy for Anyone to Get the Latest Executable
- Everyone can see what’s happening
- Automate Deployment
For the success of CI setup it is very important that team understand and make the habit of frequently check-in code, and resolve any broken build ASAP.
Please also have a look at my blog on “Continuous Delivery“.
@Mohammad Sami, Agile Coach
829 total views, 2 views today