Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: How should I do (and document) effective semi-formal code review?

by dragonchild (Archbishop)
on Jun 18, 2008 at 20:55 UTC ( #692794=note: print w/ replies, xml ) Need Help??


in reply to How should I do (and document) effective semi-formal code review?

A code review is a meeting. All meetings have inputs, attendees, agendas, and outputs. In the case of a code review, it could look something like:

  • Inputs: Code to be reviewed; Specifications for said code
  • Attendees: Author, moderator, reviewers (no, the author cannot moderate the review of his code)
  • Agenda: Review the code
  • Outputs: Suggestions for improvements

So, document that. A couple thoughts:

  • Some people talk about non-meeting code reviews, where people review the code at their leisure and give feedback via email. This system sucks because there's no impetus to do anything.
  • Unless you have management backing, you will not get people to give the amount of time necessary to review code properly. This breaks down as so (for roughly 100-200 lines of code spanning 2-3 functions):
    • 30min - 1h reading and understanding specifications (you have specs, right?)
    • 30min - 2h reading and understanding the context of the code (calling code, called code, environment, etc)
    • 1h - 3h reading and understanding the code in question
    • 1h for the actual meeting (Code reviews should never go past 1h. Anything more and the code needs rewritten or chunked better.)
    As you can see, this could be up to an entire workday per reviewer. And this doesn't count any followup reviews should the code in question need to be rewritten.

    Now, this will get better over time, but you should expect that in the worst case (and we all plan for the worst case, right?).

  • Expect a lot of egos, especially at first. It's difficult to hear someone you think is your inferior tell you what's wrong with your baby, particularly if they're right. This is why the author cannot be the moderator.
  • Don't even think you're going to teach the reviewers with your code. That's arrogance at its finest.

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?


Comment on Re: How should I do (and document) effective semi-formal code review?
Re^2: How should I do (and document) effective semi-formal code review?
by radiantmatrix (Parson) on Jun 19, 2008 at 15:39 UTC

    (you have specs, right?)

    But of course. ;-)

    Thank you much for the input. I'd not thought of the review as a meeting.

    <radiant.matrix>
    Ramblings and references
    “A positive attitude may not solve all your problems, but it will annoy enough people to make it worth the effort.” Herm Albright
    I haven't found a problem yet that can't be solved by a well-placed trebuchet

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://692794]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2014-09-21 18:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (174 votes), past polls