I need to write up some guidelines for a code review. (Most of the engineers at my company have only a general idea of what it is, but haven't done it.) Does anyone have any, or know of any online resources? (I'm googling now, but figured I'd ask for other versions as well.) --Mark
Steve McConnell's Code Complete has a nice dozen pages or so on reviews. He talks about the various roles, goals, etc. Inspections are reviews that specifically look for bugs. The author distributes code to reviewers ahead of time, a moderator runs a review session where the author explains code (should not be necessary!) and answers questions, reviewers discuss findings and probably find more bugs together, management stays away. A scribe records findings and recommendations, the moderator assigns rework follows up to see that it is done. The book claims about a 20% productivity increase because people write better code when they know others will read it and because some bugs are actually found, but they might eat up 15% of a project's cost. There are also "walk through" reviews for the purpose of knowledge transfer, where the author shows the rest of the team how some feature works. And there is a practice of code reading. This tries to find bugs in individual reading and uses the meeting just to discuss findings. An inspection does more code review during the meeting. Distribute code to sevearl readers, meet to gather their findings. Any of that help?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I think code review can never be completely automated for all that it seeks to achieve, namely, 1. That there are no obvious bugs in logic 2. That there could perhaps be a better way of doing it 3. That it is simple and self-documentary enough for someone else to be able to change it and lastly, that it makes all the reasonable assumptions and premises about the nature of the problem and all its "unknowns". Frankly, any code review would be conducted (and structured) keeping in view how many of the above mentioned goals do you seek the review to achieve.