Wednesday, September 24, 2008

Book Review: Best Kept Secrets of Peer Code Review by Jason Cohen

Recently, SmartBear Software ( offered a free book for the taking on the subject of peer code reviews. Now you may be saying, “free huh?” We have all gotten information that appears to be free but is really advertising for some product. Before making any assumptions, let me assure you this too is advertising for Code Collaborator, SmartBear’s code review software application. Having said that, I read the book anyway and was very surprised. Out of the ten chapters, only one is dedicated to the software. The other nine chapters have some really good information concerning code reviews. I recommend the read to anyone who is considering implementing code reviews as a part of their development process. Finally, let me say this is not a software review. I have never used or even seen the application in question. This review is about the book and the book alone.

The book is organized as a series of essays dealing with various topics of code review such as facts and figures, statistics, case studies and even the human factors (ego, pride and the overwhelming desire to not have your work criticized). The book starts with making a case for reviews and contrasting the what the detractors have to say about the reviews. It then goes into facts figures and a case study with Cisco Systems. The book also addresses the social effects of code reviews and analyses how to cope with that as management. Finally, once the code reviews are done, there is a chapter on capturing metrics so that you can concretely tell if the code reviews are working for your organization. There is only one chapter at the very end that pushes the product itself. All in all, the organization was very good, logically put together, and useful.

I have worked for various companies in the past, some of which engaged in code reviews. Early on, a code review would be 6 or 7 people in the room with one person saying “Anyone have a problem with line 1….. Anyone have a problem with line 2… “. This was a brutal way to spend an afternoon and usually didn’t produce results. The content of this book focuses more on reviews as a way to improve the code, not eat up valuable development time. Several different types of reviews are studied in here, not only the traditional walk-thru meeting. The book covers traditional meetings from a different point of view but also covered other techniques like email reviews and over the shoulder reviews. Of course, there is talk of tools to facilitate these kinds of reviews but nothing specific (until chapter 10 of course).

When it comes to the big review meetings, not only was time wasted but so was goodwill. If reviews aren’t handled properly, then people get angry, upset or offended. This is not a good situation to have within a team that has to cooperate work in harmony to get the job done. The book deals with techniques for helping developers to have a good feeling about the reviews. Concepts such as “don’t tie performance evaluations to quantity of defects.” When you start trying to use the results in this way, people fudge the results, hide the actual defects, try to defend an indefensible position and in the end, the big loser is the deliverable; the product itself. Code reviews should be limited to a review of the code, not a review of the people.

I also liked the section on metrics which deals with ways of collection information to support how successful your code reviews are at improving the quality of code. You can’t determine success unless you can measure it.

All in all, it was a great little book. It could have used one more pass through the editor as there were some needless typos in the book but nothing that will stand in the way of the information getting through. It is short, to the point, and inexpensive ($4.19 on Amazon at the time of this writing). I don’t know how long it will last but at the moment, SmartBear software is offering the book for free, if you will fill out the appropriate forms. The location for this is…

No comments: