Continuous Integration (CI) is one of the software practices/techniques I recently had the chance to learn and play with at the SSW’s FireBootCamp and which has completely changed the way how I see software development and how I want to craft it moving forward.
If you feel yourself identified with some of the below items you should be looking into incorporating CI practices into your software development pipeline:
- You don’t have a source control system.
- You get a copy of a project from your control system but it won’t run because there are missing files or the build is broken.
- You rarely check-in your code.
- You never get the latest version from your source control system before checking in your code to make sure any new changes made by other developers don’t break your code (or even worse, to make sure YOUR code won’t break the build)
- You don’t write unit tests
- You don’t write integration tests
- You do write unit/integration tests but don’t run them against your code AND the code that sits on the source control repository.
- You check in a task/feature only when fully completed (after days/weeks of working on it) only to realise it won’t work on UAT/staging/production
Any of the above will result in painful integrations, poor quality code (usually off-schedule), with many many bugs and with the overall experience that software development sucks (without mentioning what the end user/customer will think about the product/us).
Is there a way out?
Yes !, its called Continuous Integration and it’s relatively easy to implement (I haven’t personally had much experience to be honest but I can see the many benefits from it and the steps seem simple enough)
It’s whole concept revolves around the idea of improving your development practices by encouraging you and your team to:
- Get the latest version of the shared code before checking in your code.
- Run unit and integration tests against your code.
- Check-in your code regularly (at least daily).
- Have a build automation system.
- Have the shared code built by your build automation system
- Have the shared code verified by running automated unit and integration tests against it
- If any of the above steps fail then have the build automation tool inform you so you can fix it and start the process again.
Simple, huh? to me the greatest advantage of following this process is that you don’t need to spend separate time trying to integrate a newly built feature into your system; by checking in your code and fixing problems along the way the ‘integration’ becomes an inherent task that of the process, i.e. no need to wait for months to realise that two complex features that you and your team were working on did not integrate properly and now you have now to stay back and fix it rather than going to the pub with your friends :(.
Some others (equally important) advantages are:
- You always have a working version of your product (which could potentially be a shippable product)
- You get immediate feedback about any problem that arose as a consequence of the new code checked-in.
- Greater visibility of the current status of the product
- Isolating and tracking bugs becomes easier as it’s often related to the new code.
- Reduces the number of bugs in your application as you fix them sooner rather than when the customer rings you a month later.
- Improves communication with your team
There you go, start incorporating a continuous integration process in your software development practices if you haven’t already done so.
By the way, there are some great blog posts about this subject that I have listed below:
- Martyn Fowler’s own article about Continuous Integration, this is a great blog post as it gives clear examples on the topic and provides links for further reading.
- Continuous Integration by ThoughtWorks
- Continuous Integration on a dollar a day if you think that CI is expensive then read this one
Do you know of any other advantages that Continuous Integration provides?