Monday, June 20, 2011

Something on Continuous Integration

In the past I have been experiencing some weird practices concerning CI. In the following article I will outline some do's and don'ts when implementing continuous integration.

First and foremost it is ok to break a build that is why the thing is there you know. Comparing the number of broken builds against the ones that don't break is not a good measure of quality instead measure the time to fix the build.

Do Integrate static code analysis in your build like FxCop, Ndepend and Simian. Giving you early feedback on your code quality. If the tools give you warnings solve them as well. If you keep up on regular basis this will keep your code base clean.

Do Integrate your Unit tests to run every build. Again providing early feedback on integration issues.

Do provide visual feedback (Andon) that give people an immediate feedback when a build fails.

Don't force developers to do a get latest, run all their unit tests and then check in. This is a waste of time. But when a build fails fix it!

Don't seek who broke the build. Something that is very common is that people are very eager to investigate who broke the build and pointing fingers. Instead look what broke the build try to fix it, this will enhance collective code ownership.

Don't check in, close your laptop and sprint out of the office. This practice kills team morale.

2 comments:

  1. DONT Integrate static code analysis in your build like FxCop, Ndepend and Simian. (obfuscate things)instead run code coverage tools like NCover.

    DO integrate your unittests, if you have integration tests and they take a while create a seperate nightly build where you run them

    Don't seek who broke the build. Something that is very common is that people are very eager to investigate who broke the build and pointing fingers. Instead look what broke the build try to fix it, this will enhance collective code ownership. PLEASE DO !!!: as you are responsible when you break the build. Otherwise you get multiple fixers at the same time

    ReplyDelete
  2. PLEASE DO !!!: as you are responsible when you break the build. Otherwise you get multiple fixers at the same time

    I have problems with this... What I have seen in the past is that someone sees the build is broke, sends and email to the the guy that broke it to notify him the build is broken. Sometimes it is quicker to just fix it than to send the email. Most build notifcation trays have an option to volunteer to fix a build... use it! Sometimes when there are bigger problems its better to lift your ass from your chair go to the person that is responsible and pair with him to fix it :)

    ReplyDelete