View stunning SlideShares in full-screen with the new iOS app!Introducing SlideShare for AndroidExplore all your favorite topics in the SlideShare appGet the SlideShare app to Save for Later — even offline
View stunning SlideShares in full-screen with the new Android app!View stunning SlideShares in full-screen with the new iOS app!
What is code review?
Systematic examination of source code
Better code quality
Identification of defects
Sharing of knowledge
Also known as code inspection
How does it fit in our process
After implementation, before testing
Dedicated task state in issue tracker
Author assigns it to different person
We do not have any hierarchy, CR should be
evenly shared among all team members
How should I do it?
Notification from issue tracker
Check related svn commits
(linked via refs #1234)
See changes context in IDE
Change reviewed code
Add @TODO CR
Add comments in issue tracker
Assign it back to the author
Why we do it?
Software testing alone has limited
effectiveness - the average defect detection
rate is only 25 percent for unit testing, 35
percent for function testing, and 45 percent for
integration testing. In contrast, the average
effectiveness of design and code inspections
are 55 and 60 percent.
(S. McConnell: Code Complete)
I believe that peer code reviews are the single
biggest thing you can do to improve your code.
(J. Atwood: http://www.codinghorror.com/blog/2006/01/code-reviews-just-do-it.html)
Formal Code Review
M. E. Fagan (IBM)
Code preparation → code review acceptance
criteria → committee with moderator → individual
preparation for CR → review meeting → report
with list of defects
Group review finds only about 4% more defects
than individual reviews [Cohen 2006]
Tip 5: Accepting Code Review
Do not worry, everyone makes mistakes
Do not take it personally, it is only about code
Say Thank you :)
maybe it saved you some unpleasant fixing of
If you don't understand the code, ask the
author (and then write a comment/rename)
Finding things that are missing is the hardest
part (e.g. race condition)
The sooner CR is done the better
Explain why something is bad (provide
Use FindBugs, Sonar
Jason Cohen (2006). Best Kept Secrets of
Peer Code Review (Modern Approach.
Available at Smartbearsoftware.com