In this series we will discuss Continuous Integration and setting it up using Cruise Control .net. This is the first article of the series. In this series i'll show you how you can step your own CI process using Cruise Control .net. Lets begin with the introduction to Continuous Integration. When developing applications we are interested in creating best possible apps for our customers with the minimum amount of work. But now a days when we look, the apps are becoming more and more complex and these apps are in modular form. Although we have now advance tools like Visual studio, but creating great apps is getting difficult. There are many keys to improve the application and its productivity, one of them is automating some of the work. This can be achieved through Continuous Integration (CI) which is one of the best way of doing this. When writing the apps we divide our program in different small pieces of code.Have you ever noticed that this small piece of code is working well but when you integrate this code to major application code you came across with many difficulties? Do you always successful while integrating your code from others team member’s code? Have you ever shipped the app just for checking that it runs on client machine but you find that it is not working and you are unable to find the errors or reason? To deal with all of these problems, CI will help you.
CI basically stands for Continuous Integration and is defined as:
“Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily—leading to multiple integrations per day. Each integration is verified by an automated build(including test) to detect integration errors as quickly as possible. Many teams find that this approach leads to significantly reduced integration problems and allows a team to develop cohesive software more rapidly.”
The definition contains an important phrase “multiple integrations per day”. It means that the CI system should build the application and test it many times in day.
In simple words CI can be defined as:
It’s basically an automated process which builds, test and analyzes the app to ensure that it’s working correctly and it follows the best practices and is deployable easily. It can be run when a change is made to your code and it can also provide you a feedback mechanism which enable developers to get the bugs earlier if exists.
In short words it’s an automation of some of your work, which will reduce your time and will inform you build and unit testing results timely through feedbacks.
You will be wondering that in this discussion which we are doing what Build is? In your mind it will be as you build the project or code in the visual studio. But actually its definition varies. It could be as simple as compiling the code and unit testing it. As further you are near in releasing your application a build can includes many other features like running, testing and analyzing the code and making the installer of the application. If you are confused with the word continuous, as CI is not truly continuous because the integration is triggered at specific event or after specific intervals. While it is continuous in the context that it does its task regularly and automatically.
Here is a CI as shown in figure which will help you to understand it.
In the CI process developers commit the code into the version control repository. The automated CI checks the repository for changes of the code and then builds the new code and test it. Results are forwarded to a feedback system where team members, stakeholders can see the results.
Automating the build and the unit tests are steps in the right direction, but a good CI process can do much more for you.
Advantages of CI
There are several advantages of CI most important as follows:
1. Reduced Risks:
When you implement a good CI process you will produce good software’s as you have tested the app earlier through build results which also increases the probability of catching the bugs earlier and fixing them on time thus it reduces the risk of getting bugs after software is released.
2. Deployable Software:
If in the CI, you have added the automation of installation of software you will then know that it is installing as it should or not.
3. Increased Project Visibility:
As CI provides feedbacks, so all the project members will get the results of builds earlier and the problems or bugs will also be known earlier, so they will fix them sooner which will save both time and cost.
4. Fast Incremental Builds:
It means that as you get the build automatically and earlier, so you can test the results earlier which helps you to take a look at the bugs and fix them which increments the builds fast.
In this article we have discussed what CI is and what its advantages are; in next article we will look at CruiseControl (CI tool) and how to setup it.