Reading Joel Spolsky's latest article, Sins of Commissions, reminded me about a topic that I feel very strongly about, namely incentives for software developers based on some kind of software quality or metric. I don't know about you my dear reader, but I think this is just nuts!
Although Joel's article talks about sales, incentives are also being applied in the IT industry. I personally know several employers where these kind of 'commissions' are being given to software developers. These incentives are mostly based on metrics like code coverage, cyclomatic complexity or some other result coming from a static analysis tool. Applying such a rewarding system to software development is doomed to fail.
From the article:
Inevitably, people will figure out how to get the number you want at the expense of what you are not measuring, including things you can't measure, such as morale and customer goodwill.
His point is that incentive plans based on measuring performance always backfire. Not sometimes. Always. What you measure is inevitably a proxy for the outcome you want, and even though you may think that all you have to do is tweak the incentives to boost sales, you can't. It's not going to work. Because people have brains and are endlessly creative when it comes to improving their personal well-being at everyone else's expense.
This really hits it home. If someone gets paid based on e.g. code coverage, then he or she will find a way to write a single unit test that proves 350% code coverage to pay the mortgage. This totally defeats the purpose of quality metrics, betraying the rest of the team as well. Don't say this won't happen, because it most definitely will. You never ever achieve code quality this way.
Another sick form of incentives is rewarding people who have been in a death march for months, delivering yet-another-piece-of-unmaintainable-crap on a randomly picked date. If a team gets 3 months to deliver a software system that actually should take 6 months to build and gets rewarded for it, then the result will most definitely not be pretty. It's always going to be at the expense of something else, code quality itself in this case.
Delivering quality code/software has nothing to do with incentives, but everything with being a professional software craftsman who wants to do the best he can regardless of his salary.
Until, next time.