Wednesday, September 12, 2012

Auto-Revert and a Sense of Accomplishment

It's been one day since I set up our CruiseControl.net server to automatically revert changes that break the build and already I'm seeing an improvement.

The obvious thing I like is not having the goddamn build be broken for hours or even days on end.  However, there's already evidence of another side effect... one I expected but thought would take months to develop.

People are changing the way they treat the code base.  Time was, people were pretty "willy nilly" as to what they checked into the source control server.  Many didn't care if the build was red, how long it was red, or if they were the ones that made it red.  Now that's changed.

For one thing, if the build is red, you can't check in.  The system locks everyone out and runs one more build and test pass on any pending changes.  So the "no check in on red" rule is no longer a policy.  Now it's a thread in the fabric of our reality.

For another, there's no more "fire and forget" check-ins.  You're check-in is your responsibility.  If it works, fantastic.  If not, it's kicked back to you for fixing.  It just won't get in if it doesn't pass the tests.

Furthermore, your problem becomes everyone else's problem so there's a serious potential for some peer pressure.  If you and Joe check in at the same time and you break the build, now you own Joe's submission and are responsible for getting it into the source server.  If you don't, Joe might come knocking.

I was talking to a friend about it and they pointed out another force that I hadn't even considered.  This is probably the critical piece that made the auto-revert feature shape people's behavior so quickly.  Developers - especially old-school developers - get a sense of accomplishment when they check in some work.  That sense is largely unjustified.  You've accomplished something when you make an incremental change for the better, not just any old change.

Because the build-and-test cycle is less than thirty minutes long, the auto-revert feature has the property of providing immediate feedback on whether or not you actually accomplished something with your change.  In my friend's words: It removed the positive feedback associated with a bad check-in.  Pair that with producing some negative/constructive feedback (an email to all the leaders), and you've got a powerful behavioral modification tool.