It's Friday - what a day to visit jfoobar!

 

Continuous Integration in PHP; what, why and how?

Screenshot of a Joomla piece of code

An important part of any software development process is getting reliable builds of the software. Despite it's importance, we are often surprised when this isn't done. Continues integration is increasingly used throughout companies, and is can be used in a wide variety of programming languages. This article is the first in a series of blogs, not knowing how much articles I need to explain the full story, but in the end you will understand how you can set up a fully automated and reproducible build, including testing, validation of code against coding standards, code complexity analyses and fully automated API documentation generation that runs after every commit that is done. This allows each developer to integrate instantaneously thus reducing integration problems.

This first article is an introduction to the basics of continuous integration and what it can bring to you as a developer. The basics of this article are inspired on an article from Martin Fowler who describes how they implemented continues integration in their company. For those unfamiliar to continues integration, sometimes also referred to continuous building, one of the hardest things to grasp is a fundamental shift to the whole development pattern. Particularly difficult when you have never worked in such an environment, but once you get started you will quickly see the benefits of this approach. Most important to understand is that continues integration helps you solve the problem of code integration in a collaborative development environment.

Martin Fowler explains in his article that the fundamental benefit of continuous integration is that it removes sessions where people spend time hunting bugs where one person's work has stepped on someone else's work without either person realizing what happened. These bugs are hard to find because the problem isn't in one person's area, it is in the interaction between two pieces of work. This problem is exacerbated by time. Often integration bugs can be inserted weeks or months before they first manifest themselves. As a result they take a lot of finding.

A good example is the recent maintenance releases of Joomla 1.5.13 and 1.5.14 where a new version of a library caused other parts of the CMS to fail. An approach where continuous integration would have been implemented would most likely have prevented this problem to have arisen in the first place. With continuous integration the vast majority of such bugs manifest themselves the same day they were introduced. Furthermore it's immediately obvious where at least half of the interaction lies. This greatly reduces the scope of the search for the bug. And if you can't find the bug, you can avoid putting the offending code to be release, the worst that happens is that you don't add the feature that also adds the bug.

Is continuous building the solution for creating flawless software? In no way I will ever state that, but experience (not only from me) has proven that code quality increased dramatically. And because you find flaws instantaneously you spend less time developing the features in the end increasing productivity.

In the next article I will describe the building blocks for setting up a continuous integration environment using PHP as your development environment. After that I will describe the open source tools available for PHP, in the final article(s) I will explain how to set up a fully integrated environment that can be used in your situation. I am personally very interested in best practices out there for people/companies who have successfully implemented continues integration solutions, feel free to comment here or send me a mail at jansen dot wilco at gmail.com.

About the author Wilco Jansen

Wilco was born in 1967 in the Netherlands where he still lives. After years of being a programmer Wilco has worked as project manager and IT manager. Discovered Joomla! when he was creating his own content management system, and never lost focus after then. Joined core team as development coordinator in May 2006 just helping to make Joomla! even better then it is already. Wilco has been deeply involved in the Joomla project as Google summer of code program manager 2006, 2007 and 2008 editions, co-organizer of the Google Highly Participation contest in 2008, first ever development coordinator, creator of the Joomla bug squad, member of the board of Open source matters, regular speaker on world wide conference advocating Joomla and much, much more. Wilco has a bachelor degree in business and information engineering and studied Master of Science knowledge and information engineering at the Middlesex University in London.

More about Wilco Jansen

There are 0 comments posted.

Help for creating beautiful comments.

Enter Your Details:
Enter Your Comments:
I'm finished with the form Your form will be checked and you'll get a preview.
moovur promo

Blogging team

We have a team that works on the blogs presented on this site. Below you will find all present members who are actively working on blogs on this site.


Please contact us if you are interested in helping us out with the creation of the blogs.

Post translations

jfoobar has readers from all over the world and in many languages. If you create a translation of one of our posts and link to it than please let us know so we can add a link back to the translation at the original post.

JFoobar friends on Twitter

Follow JFoobar on twitter

Sponsored Links

Latest Comments

Aaron wrote:
2009-12-23 13:19:22 - Genius! Thanks, Wilco. I've been dying to take .
Posted in How to downlo .
Amy Stephen wrote:
2009-12-22 18:39:37 - Happy Birthday to one of Joomla!'s most noble - .
Posted in Mister Joomla .
Antonie de Wilde wrote:
2009-12-22 09:30:26 - Congrats Robin. Have a good day and watch out w .
Posted in Mister Joomla .
Robert wrote:
2009-12-22 08:51:02 - Happy Birthday Robin .
Posted in Mister Joomla .
Arno wrote:
2009-12-22 08:43:28 - Happy Birthday Robin, love your suit, you wife .
Posted in Mister Joomla .
Brian Teeman wrote:
2009-12-22 00:17:41 - Happy Birthday Robin, Welcome to the big four oh .
Posted in Mister Joomla .