Continuous Integration (CI) is a practice in Software Engineering, where all the developers local working code base will be merged to share with a common repository several times during the product development.
It was first adopted as a part of Extreme Programming (XP). The main purpose of Continuous Integration is to prevent developers stepping over each other code and eliminate integration issues.
Continuous Integration works in tandem with other best practices like Configuration management, compilation, software build, deployment, and testing which are bundled into a single automated and repeatable process.
Due to rapid integration of code, it is more likely that defects surface faster than it could compare to normal manual integration.
Continuous Integration has the following built in automation to check the validity of the code that was checked in:
- Static code analysis: Reporting the results of static code execution
- Compile: Generating the executable files by linking the code and compiling after
- Unit test: Writing unit tests, executing them, checking code coverage and reporting the results
- Deploy: Build the code and install it into a test/production environment.
- Integration test: Providing results by executing the integration tests.
- Report (dashboard): Indicating the status of key parameters by posting Red, Green, and Yellow to a publicly visible location.
The cycle of Continuous Integration has been shown below in the figure below
Figure : Cycle of Continuous Integration
- Continuous Integration helps testers to perform automation effectively to uncover defects at a faster rate and improve the regression results.
- The automation will also give the percentage of test coverage area.
- The automation report also covers the number of user stories and functionality mapped to the product increment.
- Automation also reduces the manual testing effort of the testers and makes their life easy.
- Testers can also manually test the areas of failure and collaborate with the developers to fix the defects.
- There are several tools that are being used in organizations as a part of continuous integration to build the automation scripts.
- Few examples of the tools are JUnit, Selenium, SONAR etc.
Continuous Integration automation will reduce the time to deliver, since it replaces the traditional manual testing. Build tools are linked to automation server and build server and deploy to testing, staging and production environments.
Organizations started using these build tools to replace the traditional quality control.
Advantages of Continuous Integration
- Enables a quick feedback mechanism on the build results
- Helps collaboration between various product teams within the same organization
- Decreases the risk of regression since the code is often churned by other developers.
- Maintains version control within for various product releases and patch releases.
- Reduces the technical debt within the code.
- Allows earlier detection and prevention of defects
- Reduces manual testing effort
- Provides a facility of falling back to previous versions in case of any problem to the current build
Risks and challenges of Continuous
- Continuous Integration tools maintenance and their administration have associated costs to it.
- Continuous Integration guidelines need to be well established before starting it.
- Test automation is a rare skill in the market and existing testers may have to be trained on that.
- Full fledge test coverage is required to see the benefits to automation.
- Teams sometimes depend too much on the unit testing and ignore automation and acceptance testing.
So in summary, Continuous Integration is advantageous to a project team, if the required tools are put in place for automating the build process.