The continuous integration

Labels:

Definition and usability

The integration for people that don't know what is it, the goal is to take all the source code, to build and to do all the unit tests to see if all is correct, that all things make a coherent project. Continuous says that we will do an integration as much as possible. Why? See by a concrete sample. Imagine that we have the 2 following classes: 

image

We have 2 developers X and Y, each having the latest version of the files. The method "StartRace" of the class CarRider makes a call on the method "SpeedUp" of the class Car. Now the developer X modifies and adds a parameter on the method "SpeedUp", he will also change the call of this method into the class "CarRider" and the developer Y add a class "TrustControlEngine" with a method "RegularSpeed" which calls the method "SpeedUp" of the class "Car". We have the following situation: 


Developer X
image
Developer Y
image


For the moment  the code builds for each developer, now imagine that the situation stays 2 months in this state and then they want to put the application in production, the result of the build would be catastrophic. This is evident that the code doesn't build anymore because the class "TrustControlEngine" uses the method "SpeedUp" without parameter. The continuous integration is necessary and we don't need to do it by hand, there are tools that can automate this work.

The tools

There are many tools, for the moment I know 2 tools:

The tools to do continuous integration take the latest version of all the files from a source control and check that all builds, it is possible to configure the tools to run unit tests, to analyze code, to run code coverage, ... These steps can be executed when there is a detection of check-in of after a defined elapsed time. The tool notifies us by mail (for sample) the result of the integration.

Sample of a structure that I setup with some tools: 
image







0 comments:

Post a Comment