peer code review
DESCRIPTION
Here is a presentation I created back in 2010 illustrating the benefits of peer code review in software development teams. I also discuss the Code Collaborator product from Smart Bear Software; the peer code review tool I use most regularly.TRANSCRIPT
Peer Code Review
Eric J. SilvaMarch 18, 2010
(c) 2010 Eric J. Silva 2
Agenda
Overview Types of Code Review Benefits Process Tools Resources
March 18, 2010
(c) 2010 Eric J. Silva 3
Overview
What is Peer Code Review?
The essence of code review is providing an author timely feedback on his or her changes
March 18, 2010
Peer Code Review is the systematic examination by one’s peers of computer
source code intended to find and fix mistakes overlooked in the initial development phase.1
1Source: http://en.wikipedia.org/wiki/Code_review
(c) 2010 Eric J. Silva 4
Types of Peer Code Review
Formal Fagan Inspection (traditional)
Lightweight
Over-The-Shoulder• A developer looks
over the author's shoulder as the latter walks through the code
E-mail Pass-Around• Source code
management system e-mails code to reviewers automatically after check-in is made
Pair Programming• Two authors
develop code together at the same workstation
Tool Assisted• Authors and
reviewers use specialized tools designed for peer code review
March 18, 2010
(c) 2010 Eric J. Silva
Formal Code InspectionFagan Inspection
Traditional process Involves a careful and detailed process
Multiple participants Multiple phases
Developers attend a series of meetings Review code line by line Using printed copies of the code
Extremely thorough and effective Can take too long to be practical Very difficult to do with current geographic environment
5March 18, 2010
(c) 2010 Eric J. Silva 6
Lightweight Code Reviews
Less overhead than formal code inspections
Equally effective when done properly Part of the normal development
process Less paper Meetings and phone calls are rare More time efficient Geographical / time zone friendly Historical and auditing capabilities
March 18, 2010
(c) 2010 Eric J. Silva
Benefits
Authors need editors to catch mistakes It is human nature that one cannot adequately proof-read
one's own work Improve the overall quality of software
Algorithm Logic Documentation
Improve the developers' knowledge Development skills – new/better ways of doing things Understanding of the application code at work
Enforce and maintain coding standards Ensure maintainability of code Find bugs early to minimize re-work efforts
and …
7March 18, 2010
(c) 2010 Eric J. Silva
Review Process Using Code Collaborator
Simplified (Yet Effective) Process No Meetings Works well with all team sizes,
geographical locations and time zones
8
1. Planning• Upload Files• Invite
Participants
2. Inspection• Find Defects• Comment &
Chat
3. Rework• Fix Defects• Upload Fixes
4. Complete• Check Files Into
Version Control
March 18, 2010
(c) 2010 Eric J. Silva 9
Who Participates In Code Reviews?
Author Responsible for the changes or documents under review Responds to comments and questions made by reviewers and observers
Reviewers Responsible for inspection, creating defects, etc. Will come to a consensus about each questionable item Minimum of 2 per review
Observers Are involved and make comments but they are not "vital" to the review Usually used when you want to:
▪ Bring in someone who has special expertise on an issue▪ Make someone aware of a change in code, but not make their participation mandatory
Moderator Maintains the pace and tenor of the review Used for more formal review workflows where one person leads and controls the
reviewMarch 18, 2010
(c) 2010 Eric J. Silva
Review Process Roles
10March 18, 2010
(c) 2010 Eric J. Silva
Code Review Tools
Commercial Code Collaborator
http://www.smartbear.com
Cruciblehttp://www.atlassian.com/software/crucible
Open Source Review Board
http://www.reviewboard.org
Rietveldhttp://code.google.com/p/rietveld
11March 18, 2010
(c) 2010 Eric J. Silva
Code Collaborator
Multiple, simultaneous reviewers Automated workflow enhancing author-reviewer collaboration Version control integration Multiple Clients, including Eclipse IDE and Visual Studio
integration Syntax highlighting Defect-tracking with severity, type, classification, and checklists External issue/defect tracking integration Full-featured metrics, reports, and data-export Project- and role-based rules and reporting Instant messaging like communication LDAP integration for authentication
12
Code Collaborator is a web-based,
peer code review tool.
March 18, 2010
(c) 2010 Eric J. Silva
Code CollaboratorDashboard
13March 18, 2010
(c) 2010 Eric J. Silva 14
Code CollaboratorSource Control Integration
CVS Subversion Git Mercurial StarTeam ClearCase Perforce Visual SourceSafe Others …
March 18, 2010
(c) 2010 Eric J. Silva 15
Code CollaboratorClients and IDE Integration
GUI and Command Line Client Windows, Solaris, Linux, Mac OSX, BSD
Eclipse IDE Integration Update Site:
http://eclipse.smartbearsoftware.com/ Eclipse 3.1+ and Java 1.5, 1.6
Visual Studio Integration Uses Command Line Client VS Add-in Download:
http://smartbear.com/downloads/CcollabAddinSetup.msiMarch 18, 2010
(c) 2010 Eric J. Silva
Code CollaboratorSyntax Highlighting ASPX C, C++ C# CSS HTML Java, JSP JavaScript Perl PHP Python
Ruby SGML Shell Visual
Basic XML
16March 18, 2010
(c) 2010 Eric J. Silva
Resources
Best Kept Secrets of Peer Code ReviewJason Cohen (2006)http://smartbear.com/codecollab-code-review-book.php
Code Collaboratorhttp://smartbear.com/products/development-tools/code-review
11 Best Practices for Peer Code Review http://smartbear.com/docs/BestPracticesForPeerCodeReview.pdf
Peer Reviews in Software: A Practical GuideKarl Wiegershttp://www.amazon.com/exec/obidos/ASIN/0201734850
Lightweight Tool Support For Effective Code Reviewshttp://www.atlassian.com/software/crucible/learn/codereviewwhitepaper.pdf
17March 18, 2010