What is Continuous Integration(CI)?
Continuous integration is a process in which all the development activities (every day activities) are integrated at a given point of time by compiling and building the project and well tested. The basic idea behind the continuous integration is to ensure that there are no compilation issues at the end of the day by numerous check ins made by the developers in a team. Also, this would enable to identify any compilation issues at the early stages of the development process.
In this process, all the developers activities are collaborated and merged at the central system (repository at which all the check ins are made). The main aim again here in this process is to eliminate the "integration problems". Each and every integration is automatically built, deployed and tested thoroughly.
Some History about CI
The phrase Continuous Integration was first coined by Grady Booch in 1994. He coined this phrase in object oriented analysis & design application in order to explain how the small internal releases plays a vital role while developing the micro processes. In 1997, an American software engineer named Kent Beck with another person named Ron Jeffries invented Extreme Programming with the continuous integration.
Continuous Integration (CI) was originally invented in order to be used with the combination of automated unit tests written in a test driven development environment. i.e to run all the unit tests in the local environment of the developer's machine and ensure that all the tests were passed successfully without any other issues before it is pushed into the main repository. This was an extra care taken in order to avoid any breakages on the working copies at the main streams especially when developers are working at the same module.
Best Practices of CI
- Maintain a proper code repository.
- Automate the build process.
- Ensure every developer commits the files to the main stream every day.
- Every commits made should be built.
- Results of the build should be made transparent, so that all the developers will be aware of the quality of the build every day.
- Test the build in a production look-like environment.
- Broken builds should be fixed immediately.
- Everyone should be able to get the latest build from the main stream.
- Automate the deployment process.
Advantages of CI
- Reduced level of risk.
- No longer integration process.
- Lot of bad code smells & bugs can be reduced at the early stages of the development process.
- Frequent deployment process is easier and faster.
- Easy to implement the process by using tools like Jenkins (earlier known as Hudson) and cruise control.