Principles of Continuous integration
Continuous integration is 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.
Automated tools such as CruiseControl, Jenkins, Hudson, Bamboo, BuildMaster, AnthillPro or Teamcity 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.
Continuous integration relies on the following principles :
1. Maintain a code repository
- Use of a revision control system for the project's source code.
- All artifacts required to build the project should be placed in the repository.
- System should be buildable from a fresh checkout and not require additional dependencies.
- The mainline (or trunk) should be the place for the working version of the software.
2. Automate the build
- A single command should have the capability of building the system.
- Tools like Ant, Maven, Gradle, MSBuild, OpenMake Meister or IBM Rational Build Forge are frequently used in continuous integration environments.
- The build script not only compiles binaries, but also generates documentation, website pages, statistics and distribution media.
3. 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.
4. Everyone commits to the baseline every day
- By committing regularly, every committer can reduce the number of conflicting changes.
- In addition performing a nightly build is generally recommended.
5. 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.
- Automated Continuous Integration can be used where a continuous integration server or daemon monitors the version control system for changes, then automatically runs the build process.
6. Keep the build fast
- The build needs to complete rapidly, so that if there is a problem with integration, it is quickly identified.
7. 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.
- Building a replica of a production environment is cost prohibitive.
8. 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.
- Finding errors earlier also, in some cases, reduces the amount of work necessary to resolve them.
9. 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.
10. Automate deployment
- Most CI systems allow the running of scripts after a build finishes.
No comments:
Post a Comment
Note: only a member of this blog may post a comment.