Continuous Integration considered bad for your ongoing project health
Tuesday, October 9th, 2007Simon Stewart and Julian Simpson had a public discussion about the benefits or not of developing a build pipeline.
As you may be able to read from my headline, I’m a huge fan of CI and build pipelines!
Actually, I am a big fan of continuous integration and cruise control where it helps the project. However we can sometimes get over enamoured of continuous integration builds.
Many of the standard XP texts explain that you need CI, and in a way they are right. The benefits that automated tests give are enormous. You have the safety fallback that if you manage to accidentally affect the behaviour of the current system, and you can actively prevent against reintroducing bugs.
But the cost of doing so is that as the project gets bigger, your tests may start to take longer to run. At this point there are many technical solutions to the problem, of which the build pipeline is one of many. However the problem is not a technical problem.
Lets break it down shall we?
The problem is that running the integration tests take too long.
As with any agile system, we can decide to either
a) throw more money at it (read developer time)
b) throw more time at it (read, leave it alone)
c) reduce the scope (read, remove tests)
Yes you read that last one right, you can remove tests. It’s possible, and although you may feel dirty for suggesting it, you have to look at your tests and decide if they are giving you value.
So how does removing tests help us? well in the case of a continuous integration system, the tests are required tests that show that the system is in a workable state. Aren’t they? or are they?
Certainly at our company we use test driven development, so for every story we will have a number of “fast” tests, these are unit tests, run through jUnit, and some database tests which are also run through jUnit, but actually access a live database. Secondly we often write a couple of selenium tests, these script a web-browser session, and test that the features asked for in the user story.
However after the project has been live for nearly a year, and we have delivered hundreds of stories, we now have a lot of tests. Many of the selenium tests test features that we no longer touch, and don’t provide useful feedback, all they do is absorb development time.
So maybe our next step should be to remove those tests that don’t provide any value.
Of course if we remove the tests, what happens if we want to work in those areas?
Well, I don’t recommend actually removing the tests. Currently our tests take at least 30 minutes to run, when run in a CI environment, on every checkin, that is an inexcusably long time, however, run by the QA department, by hand, when they are ready to accept a build into the full QA testing process (which may take a few days), they are worth running. By moving the tests, we speed up the pipeline of doom, even down to the point it may be possible to remove the pipeline and return to a single CI build.