Broken Tests... I Told You To 'Save'
Failing tests are the worst, especially when caused by a silly cut / paste mistake (an instance variable had to be changed to be a local variable, but guess who forgot to remove the '@' sign...). While my tests run again to make sure it's all good now, I thought I'd share a little routine we do here at RepairPal when this happens.
In the spirit of getting feedback as quickly as possible after we commit our code changes, we have a continuous integration server (running Hudson, which is very awesome). This, of course, will pull our code changes and run all tests we've written so far, letting us know when something failed along the way. But instead of being notified by emails, we decided to make things a bit more fun. We plugged in a pair of speakers to the CI server, and using the text-to-speech tool Festival, we'll get a nice voice notification of who broke the build when tests fail. It's a great way to get the instant feedback needed to fix things when they're most fresh in our minds. The only drawback is the fact that one of our developers is in Romania, so he doesn't get to hear our Hudson box yell at him. He does get notified via Campfire, though.
However, the fun doesn't end there. I bought a cheap piggy bank that looks like a big keyboard key with the word 'Save' on it:
Whenever someone commits code that breaks our test suite, not only do they have to suffer the embarrassment of having Hudson bark at them, but they also have to pay a dollar to our 'Broken Tests' fund, and have the dreaded 'Save' button sit at their desk as a reminder to save things before committing. The 'Broken Tests' fund goes towards the bar downstairs, where us local developers spend the cash on beers for the team. Thankfully we don't break the test suite often enough to get beer often. It's a punishment, but it leads to a good thing, eventually.
Does your team have any sort of 'punishments' when one of the developers breaks the build? We're constantly thinking about different things to add to our little routine, just to keep things light around here.