Build Hygiene

Our company recently went through a restructuring and so I’ve ended up on a new team. This team is going to be taking over the testing and regression scripts for parts of a number of other teams.  For the last couple of weeks I’ve been working on moving test runs over so that they can run on the machine resources we have in our business unit. As part of this I have had the chance to see a number of different build scripts and test running scripts as well as a number of different ways of setting up builds in TeamCity.

One of the things I noticed was that some builds and scripts were a lot easier to understand and convert than others.  Overall most teams were trying to do very similar things but each group ended up using TeamCity in different ways.  This got me thinking about code hygiene and how this applies to builds and build tools as well.  It seems that often the build process gets approached from the ‘git er done’ perspective.  It is often a high pressure area since we need to keep the build pipeline alive and moving or people get pretty upset, and this can sometimes lead to hacking things in to make it work.  One little thing follows another and soon the build scripts and processes are so complicated they can hardly be understood by an outsider.

It might seem that this doesn’t matter, but I think it does – and not just because I’m going through a conversion process right now.  You could (probably rightly) argue that moving a bunch of tests and builds to another team is not a common occurrence, but the reality is that in the builds as in everything else in software development, change is the only constant.  There are always going to be things that need to be changed and especially in the build process, these changes are often going to need to happen quickly.  What happens if you are out and someone else has to maintain the builds? What happens if your build setups and scripts get to large and fragile?  You start to threaten the ability to quickly make the changes that you need too to keep the build chain running smoothly. Just like with your code, it is important to practice build hygiene. Take some time to clean things up once in a while and make sure that you aren’t building up technical debt in your build process.


Leave a Comment

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s