The following is an excerpt from Continuous integration: Improving software quality and reducing risk, by Paul Duvall, Steve Matyas and Andrew Glover. Read the complete chapter about the value of continuous integration for free.
This chapter attempts to answer the questions that you may have when making the decision to implement the practices of continuous integration (CI) on a project. It provides an overview of the advantages and disadvantages of continuous integration, and covers how continous integration complements other software development practices.
At a high level, the value of continuous integration is to:
- Reduce risks
- Reduce repetitive manual processes
- Generate deployable software at any time and at any place
- Enable better project visibility
- Establish greater confidence in the software product from the development team
Let's review what these principles mean and what value they offer.
Continuous integration reduces risks
By integrating many times a day, you can reduce risks on your project. Doing so facilitates the detection of defects, the measurement of software health, and a reduction of assumptions.
- Defects are detected and fixed sooner—Because CI integrates and runs tests and inspections several times a day, there is a greater chance that defects are discovered when they are introduced (i.e., when the code is checked into the version control repository) instead of during late-cycle testing.
- Health of software is measurable—By incorporating continuous testing and inspection into the automated integration process, the software product's health attributes, such as complexity, can be tracked over time.
- Reduce assumptions—By rebuilding and testing software in a clean environment using the same process and scripts on a continual basis, you can reduce assumptions (e.g., whether you are accounting for third-party libraries or environment variables).
CI provides a safety net to reduce the risk that defects will be introduced into the code base. The following are some of the risks that CI helps to mitigate. We discuss these and other risks in the next chapter.
- Lack of cohesive, deployable software
- Late defect discovery
- Low-quality software
- Lack of project visibility
Continuous integration reduces repetitive processes
Reducing repetitive across all project activities, including code compilation, database integration, testing, inspection, deployment, and feedback. By automating CI, you have a greater ability to ensure all of the following.
- The process runs the same way every time.
- An ordered process is followed. For example, you may run inspections (static analysis) before you run tests—in your build scripts.
- The processes will run every time a commit occurs in the version control repository.
- This facilitates
- The reduction of labor on repetitive processes, freeing people to do more thought-provoking, higher-value work
- The capability to overcome resistance (from other team members) to implement improvements by using automated mechanisms for important processes such as testing and database integration
Continuous integration generates deployable software
CI can enable you to release deployable software at any point in time. From an outside perspective, this is the most obvious benefit of CI. We could talk endlessly about improved software quality and reduced risks, but deployable software is the most tangible asset to "outsiders" such as clients or users. The importance of this point cannot be overstated. With CI, you make small changes to the source code and integrate these changes with the rest of the code base on a regular basis. If there are any problems, the project members are informed and the fixes are applied to the software immediately. Projects that do not embrace this practice may wait until immediately prior to delivery to integrate and test the software. This can delay a release, delay or prevent fixing certain defects, cause new defects as you rush to complete, and can ultimately spell the end of the project.
Continuous integration enables better project visibility
CI provides the ability to notice trends and make effective decisions, and it helps provide the courage to innovate new improvements. Projects suffer when there is no real or recent data to support decisions, so everyone offers their best guesses. Typically, project members collect this information manually, making the effort burdensome and untimely. The result is that often the information is never gathered. CI has the following positive effects.
- Effective decisions -- A CI system can provide just-in-time information on the recent build status and quality metrics. Some CI systems can also show defect rates and feature completion statuses.
- Noticing trends -- Since integrations occur frequently with a CI system, the ability to notice trends in build success or failure, overall quality, and other pertinent project information becomes possible.
Continuous integration establishes greater product confidence
Overall, effective application of CI practices can provide greater confidence in producing a software product. With every build, your team knows that tests are run against the software to verify behavior, that project coding and design standards are met, and that the result is a functionally testable product.
Without frequent integrations, some teams may feel stifled because they don't know the impacts of their code changes. Since a CI system can inform you when something goes wrong, developers and other team members have more confidence in making changes. Because CI encourages a single-source point from which all software assets are built, there is greater confidence in its accuracy.
|Continuous integration: Terms of the trade|
Continue reading this free chapter about continuous integration
Read other excerpts from data management books in the chapter download library