Code review. informal formal ad hoc reviewpair programmingwalk throughinspection/review.
-
Upload
alberta-hancock -
Category
Documents
-
view
214 -
download
1
Transcript of Code review. informal formal ad hoc reviewpair programmingwalk throughinspection/review.
![Page 1: Code review. informal formal ad hoc reviewpair programmingwalk throughinspection/review.](https://reader036.fdocuments.in/reader036/viewer/2022082819/56649f2b5503460f94c45e0e/html5/thumbnails/1.jpg)
Code review
![Page 2: Code review. informal formal ad hoc reviewpair programmingwalk throughinspection/review.](https://reader036.fdocuments.in/reader036/viewer/2022082819/56649f2b5503460f94c45e0e/html5/thumbnails/2.jpg)
Code review
informal formal
ad h
oc r
evie
w
pair
prog
ram
min
g
wal
k th
roug
h
insp
ectio
n/re
view
![Page 3: Code review. informal formal ad hoc reviewpair programmingwalk throughinspection/review.](https://reader036.fdocuments.in/reader036/viewer/2022082819/56649f2b5503460f94c45e0e/html5/thumbnails/3.jpg)
Characteristic Walkthrough Review
Leader author moderator
Granularity at author’s discretion small chunks
Recorder maybe yes
Documented procedure
maybe yes
Specific participant roles
no yes
Defect checklist no yes
Data analyzed no yes
Appraisal made no yes
![Page 4: Code review. informal formal ad hoc reviewpair programmingwalk throughinspection/review.](https://reader036.fdocuments.in/reader036/viewer/2022082819/56649f2b5503460f94c45e0e/html5/thumbnails/4.jpg)
Effectiveness
• Studies:– formal review found 16-20 defects per KLOC
vs. 3 per KLOG for walkthrough– formal review found 50% defects than
walkthrough
![Page 5: Code review. informal formal ad hoc reviewpair programmingwalk throughinspection/review.](https://reader036.fdocuments.in/reader036/viewer/2022082819/56649f2b5503460f94c45e0e/html5/thumbnails/5.jpg)
Preparation
prepare work products
examine workproducts
prepare reviewpackage
ready forreview?
read package
study workproducts
prepare comments
schedule reviewsend out packages
Author Moderator Reviewers
YN
![Page 6: Code review. informal formal ad hoc reviewpair programmingwalk throughinspection/review.](https://reader036.fdocuments.in/reader036/viewer/2022082819/56649f2b5503460f94c45e0e/html5/thumbnails/6.jpg)
Work products
• Materials to be reviewed– use cases– class and sequence diagrams– code– test results– complexity risk analysis
• A proposed structure for the review– table of contents of work products– what will be reviewed and the order– what types of issues will be covered
roadmap to code
![Page 7: Code review. informal formal ad hoc reviewpair programmingwalk throughinspection/review.](https://reader036.fdocuments.in/reader036/viewer/2022082819/56649f2b5503460f94c45e0e/html5/thumbnails/7.jpg)
Preparation
prepare work products
examine workproducts
prepare reviewpackage
ready forreview?
read package
study workproducts
prepare comments
schedule reviewsend out packages
Author Moderator Reviewers
YN
![Page 8: Code review. informal formal ad hoc reviewpair programmingwalk throughinspection/review.](https://reader036.fdocuments.in/reader036/viewer/2022082819/56649f2b5503460f94c45e0e/html5/thumbnails/8.jpg)
Preparation
prepare work products
examine workproducts
prepare reviewpackage
ready forreview?
read package
study workproducts
prepare comments
schedule reviewsend out packages
Author Moderator Reviewers
YN
![Page 9: Code review. informal formal ad hoc reviewpair programmingwalk throughinspection/review.](https://reader036.fdocuments.in/reader036/viewer/2022082819/56649f2b5503460f94c45e0e/html5/thumbnails/9.jpg)
Review package
• Intro
• Agenda
• Criteria
![Page 10: Code review. informal formal ad hoc reviewpair programmingwalk throughinspection/review.](https://reader036.fdocuments.in/reader036/viewer/2022082819/56649f2b5503460f94c45e0e/html5/thumbnails/10.jpg)
Review package - Intro
• Background– What project are we discussing– What do reviewers need to know about it
• history, key problems, important decisions, etc.
– Where can reviewers find more info• requirements, designs, analysis
• Goals for review– specific work products to be reviewed– scope (what is in/out of bounds)– what approval means
![Page 11: Code review. informal formal ad hoc reviewpair programmingwalk throughinspection/review.](https://reader036.fdocuments.in/reader036/viewer/2022082819/56649f2b5503460f94c45e0e/html5/thumbnails/11.jpg)
Review package - agenda
The order materials will be reviewed.
![Page 12: Code review. informal formal ad hoc reviewpair programmingwalk throughinspection/review.](https://reader036.fdocuments.in/reader036/viewer/2022082819/56649f2b5503460f94c45e0e/html5/thumbnails/12.jpg)
Review - criteria
These need to be determined by the author and moderator depending on the situation. For a code review you might consider:
• Does the UML realize the use cases?• Does the code realize the UML?• Does the code reflect good and consistent style?• Is the code easy to understand? Is it simple but not
“clever”? Is it documented as needed?• Is the code efficient?• Is error handling adequate?• Are the underlying algorithm correct and correctly
implemented?• Do common errors occur? missing cases, off-by-one, etc.
![Page 13: Code review. informal formal ad hoc reviewpair programmingwalk throughinspection/review.](https://reader036.fdocuments.in/reader036/viewer/2022082819/56649f2b5503460f94c45e0e/html5/thumbnails/13.jpg)
Style
• Code appearance: indentation, alignment, whitespace, tabs
• Naming: appropriate choice of names
• Consistency: same style throughout
![Page 14: Code review. informal formal ad hoc reviewpair programmingwalk throughinspection/review.](https://reader036.fdocuments.in/reader036/viewer/2022082819/56649f2b5503460f94c45e0e/html5/thumbnails/14.jpg)
Preparation
prepare work products
examine workproducts
prepare reviewpackage
ready forreview?
read package
study workproducts
prepare comments
schedule reviewsend out packages
Author Moderator Reviewers
YN
![Page 15: Code review. informal formal ad hoc reviewpair programmingwalk throughinspection/review.](https://reader036.fdocuments.in/reader036/viewer/2022082819/56649f2b5503460f94c45e0e/html5/thumbnails/15.jpg)
Reviewer responsibility
• Each reviewer should have specific responsibility
• Review materials relevant to those responsibility
• Test executable
![Page 16: Code review. informal formal ad hoc reviewpair programmingwalk throughinspection/review.](https://reader036.fdocuments.in/reader036/viewer/2022082819/56649f2b5503460f94c45e0e/html5/thumbnails/16.jpg)
Review process
• Moderator– keeps review moving– ensures all voices are heard and key points covered– ensures decisions are made: accepted, major/minor
revisions, further review
• Recorder– takes notes, records all issues raised and decisions
reached, all questions, suggestions, and action items– publishes a report of the review
![Page 17: Code review. informal formal ad hoc reviewpair programmingwalk throughinspection/review.](https://reader036.fdocuments.in/reader036/viewer/2022082819/56649f2b5503460f94c45e0e/html5/thumbnails/17.jpg)
Review process cont.
• Reviewers– Each member leads on their portion of the
code– When not leading, follow along, raise
questions, concerns, point out problems
• Author– Answers questions but is otherwise silent
![Page 18: Code review. informal formal ad hoc reviewpair programmingwalk throughinspection/review.](https://reader036.fdocuments.in/reader036/viewer/2022082819/56649f2b5503460f94c45e0e/html5/thumbnails/18.jpg)
Review cont.
• Stick to specified level
• Avoid re-specifying/designing system
• Avoid getting sidetracked