10 Best Practices For Peer Code Review

  • Published on
    11-Jan-2017

  • View
    3.865

  • Download
    0

Transcript

PowerPoint Presentation

10 BEST PRACTICES FORPEER CODE REVIEW

1@SmartBear @CollaboratorSB #CodeReview

#@SmartBear @CollaboratorSB #CodeReview

1. Review Fewer Than 400 Lines Of Code At A TimeReviewing 200-400 lines of code over 60 to 90 minutes, should yield 70-90% defect discovery.Reading beyond 400 lines of code, the ability to find defects diminishes

#@SmartBear @CollaboratorSB #CodeReview

#@SmartBear @CollaboratorSB #CodeReview

2. Aim For An Inspection Rate Of Less Than 300-500 Lines Of Code Per HourCode reviews that happen in a reasonable quantity and at a slower pace for a limited amount of time results in the most effective code review.

#@SmartBear @CollaboratorSB #CodeReview

#@SmartBear @CollaboratorSB #CodeReview

3. Do Not Review For More Than 60 Minutes At A TimePerformance starts dropping off after about 60minutes of work reviewers wear out and stop finding defects.Studies show that taking breaks over a period of time can improve the quality of work.

#@SmartBear @CollaboratorSB #CodeReview

4. Authors Should Annotate Source Code Before The Review BeginAnnotations should be directed at other reviewers to ease the process and provide more depth in context. As an added benefit, the author will often find additional errors before the peer review even begins.More bugs found prior to peer review will yield in lower defect density because fewer bugs exist overall.

#@SmartBear @CollaboratorSB #CodeReview

#@SmartBear @CollaboratorSB #CodeReview

5. Set Quantifiable Goals & Capture Metrics To Improve Processes Decide in advance the goals of the code review process and how you will effectively measure them. Include internal process metrics such as inspection rate, defect rate, and defect density.

#@SmartBear @CollaboratorSB #CodeReview

6. Use A Checklist For Both Reviewers & Authors Checklists are the most effective way to eliminate frequently made errors and to combat the challenges of omission finding.

#@SmartBear @CollaboratorSB #CodeReview

7. Establish A Process For Fixing Defects FoundTo ensure that bugs get fixed, use a collaborative code review tool that allows reviewers to log bugs, discuss them with the author and approve changes.

#@SmartBear @CollaboratorSB #CodeReview

8. Foster A Positive Code Review Culture In order for peer code review to be successful, its extremely important that mangers create a culture of collaboration and learning in peer review.

Peer review also allowsjunior team members to learn from senior leaders and for even the most experienced programmers to break bad habits.

#@SmartBear @CollaboratorSB #CodeReview

9. Embrace The Subconscious Implications Of Peer Review "Spot checking" 20% to 33% of the code resulted in lower defect density with minimal time expenditure.

Lessen the likelihood of the Big Brother effect by using metrics & reports to help improve a developers work

#@SmartBear @CollaboratorSB #CodeReview

10. Practice Lightweight Code ReviewsTo fully optimize your teams time and to effectively measure its results, a lightweight, tool-assisted process is recommended.

Lightweight code review takes less than 20% the time of formal reviews and finds just as many bugs

#@SmartBear @CollaboratorSB #CodeReview

With the right tools and best practices, your team can peer review all of your code!FREE TRIAL

#@SmartBear @CollaboratorSB #CodeReview

Recommended

View more >