| 
Why review code? PDF Print E-mail
Wednesday, 27 September 2006
Aren't code reviews a waste of developer time?  That's what QA is for!

Forget ROI and cost ratio charts for a second.  What's the common-sense argument for peer code review?
Here's a common-sense argument:

While writing my book I asked several professional editors about what it's like reviewing prose.  The general consensus was that every page of prose contains about 10 errors.  This is true even with professional writers (which I am not).

None of us can write a page of prose without commiting various errors of style, clearness, and grammar.  Not even professionals.  Writers are too close to the content to step back and see problems.  And writers just need another set of eyeballs pointing out the "obvious" flaws.

It's not the end of the world.  It's just how humans work.

Now consider your software developers.  They write reams of code.  Often many pages of code per day.  Oh, and prose too (or do your developers not write comments?).

Do you expect them to write perfect, glistening code without any editorial work?  No little mistakes?  No subtle algorithm problems?  No need to consult with the group's expert on certain matters?

Human editors work for prose; it's sensible that it might work for code.

But you don't want to waste precious developer time.  Is the time taken during review worth the defects you remove?  Now you're talking about data... but before we get there, consider this:

With requirements and design work we always have peer review.  We often collect data in private but always synthesis in meetings and agree in groups.  We argue pro's and con's of various choices.  When we're done we're confident that we've beat the horse to death and did our best to turn over good ideas to the development team.

So why don't we do this during development?  OK, we can't afford to have a full-fledged meeting for every little code change, but isn't it sensible that some review would be useful with some of the code?  Maybe when we make changes in the "stable" code branch?  Or when we change a core module?  Or just when working on a complex problem?

Now that you have the common-sense argument, you might want to read some stories and get some data.  For that, check out Part 1 of my 8-part article series on Lightweight Peer Code Reviewer here on CM Crossroads.
Trackback(0)
Comments (2)add comment
0
Jim Harrington: ...
Also, code reviews:
1. Can identify dead code
2. Can identify where potential error conditions should be checked but are not in the current code, and QA almost never reproduces all possible error conditions.
3. QA may not run a "full regression" after every check-in or before patch releases. Code reviews can catch bugs that QA won't test for.
1

August 29, 2007
Votes: +0
0
vijay kumar jitta: ...
Peer reviews in code helps a lot.
four things peer review help in
1. review the code and see to the standards of coding conduct that are agreed are met.
2. Bugs may or may not be caught.
3. improve your coding style or help peers to improve their coding styles.
4. decreases the risk of programmer leaving the team and no one to handle the project.


its difficult to improve perfection, always making sure that it happens is good for the project in its development phase.
2

August 21, 2007
Votes: +0

Write comment
smaller | bigger

security image
Write the displayed characters


busy
Last Updated ( Wednesday, 27 September 2006 )
 
If you already have an account on CM Crossroads, Login Now. If you do not, register using the link below...

NOTE: Once you register you will need to activate your account by clicking the link sent to you by email.

Video News

Agile in turbulent times Webinar