How Much Code Inspection is Enough?

When we first introduced mandatory code review at BlackStar, where another member of the development team had to review the code before it went live, we ran into the perennial problem of how long such reviews should take. Some people took twice as long as others, but this diligence would often pay off when they found a subtle bug that may have otherwise been missed.

In this article from Crosstalk, Robert T. McGann proposes a formula that can be applied to decide what rate of review/inspection is best for your organisation based on the cost of review vs the cost of later rework.

A graph of time spent vs excess labour time shows quite a clear “law of diminishing returns” in what McCann calls “Murphy’s Tongue”, named after Murphy’s Law “because any variation from the optimum, no matter how well intentioned, will increase development costs”.

Actually using the model to get an optimum “lines of code per hour” rate (91.29 in the example given!), is probably overkill for most organisations, particularly as you need to fill in over 20 variables that most non-CMM level 4 or 5 groups probably won’t know. And groups that can use it will need to adapt it slightly to cope with individual review speeds if reviews aren’t done by the entire team. But the basic idea is quite simple, quite obvious (once you’ve seen it), and, I would assume, quite rare.

Leave a Reply

Your email address will not be published. Required fields are marked *