Presentation is loading. Please wait.

Presentation is loading. Please wait.

Code Reviews Assignment Each team should perform a code review

Similar presentations


Presentation on theme: "Code Reviews Assignment Each team should perform a code review"— Presentation transcript:

1 Code Reviews Assignment Each team should perform a code review
Select a section of code Select your more difficult code sections. Other members of the team and the instructor will be given copies of the code to review at least 48 hours ahead of time. The code review should last about 1 hour. Don’t select too much code – about 300 lines is good

2 Code Reviews Objectives
Find bugs in the least costly manner Ensure that coding standards are maintained Train staff and disseminate knowledge of system implementation Make sure code is readable and maintainable

3 Formal Inspection All participants are given copies of the code to be reviewed before the review (usually a couple of days ahead of time) The reviewers review the code before the meeting The code author and other team members gather to review the code The principal goal is to find bugs (defects), not fix them

4 Formal Inspections Roles
Moderator Sets the pace Arranges meeting and manages materials Reports Results Follows up Author Answers questions Explains things that are unclear (and will obviously have to be changed.)

5 Formal Inspection Roles ContInued
Reviewer Fellow programmer Tester High-level architect Scribe Records problems (the official record of the review) Records action items Management must be excluded from the meeting

6 How much Code should Be Reviewed in one Meeting?
Enough to consume about an hour’s time Number of lines of code varies significantly with code complexity

7 Inspection Meeting Someone other than the moderator or author reads or paraphrases the code Reviewers make relevant comments as the code is read Remember you are looking for bugs Address the code – not the programmer (“The code does” … rather than “You did…”) “Egoless” is the goal, but seldom the reality Reviewers don’t recommend fixes

8 Inspection Report Issued within 24 hours of the meeting
Report is a record of what was found “What was found” provides statistics for management on efficacy What was found provides opportunity for follow-up

9 Reworks and Follow-up Rework Follow-up The author fixes the defects
The moderator is responsible for seeing that the defects have been addressed, but it is up to the author to make decisions about what needs to be changed. Review the code again Review relevant sections only No formal review

10 Third-Hour Meeting Optional informal meeting in which reviewers discuss solutions. This meeting should only be held if the author requests it, or if there are significant urgent problems.

11 Alternatives Over-the-shoulder Reviews Email (pass-around) reviews
Author walks through code with one peer Less formal Less documentation/assurance of completion No formal followup (pass-around) reviews Not constrained to place/time Can be difficult to track the conversation Pair-Programming Pairs can be too close to the code to see problems May be more time-consuming/expensive Can be combined with formal reviews


Download ppt "Code Reviews Assignment Each team should perform a code review"

Similar presentations


Ads by Google