Introduction to Inspection
Motivation
- Inspection results at BNR [Russell, IEEE Software, 1991]
- 2.5 million lines of code inspected
- On average, one fault found per person-hour invested
- 2-4 times as effective as testing
- On average 4.5 person-days to fix a failure reported
from the field
- Standard practice at many other companies: IBM, AT&T, Tandem.
- A career skill: at your next interview, mention that you
have code inspection skills.
The inspection roles
- Moderator
-
Controls the meetings and
ensures conduct is focused and professional.
- Reader
-
Paraphrases the code or documentation.
- Recorder
-
Records any faults found.
- Others
-
Designer, implementor, tester.
The inspection procedure
- Overview meeting
-
Overview of code to be inspected
- Individual preparation
-
Each team member studies the code alone
- Inspection meeting
-
- Reader paraphrases the code
- Other inspectors listen and speak up only if they
see a fault
- As soon as a fault is identified and recorded,
move on to the next block of code.
- Rework
-
Remove any faults found
- Follow-up
-
Moderator ensures that the rework has been done.
If more than 10% of the code is faulty,
run the entire inspection procedure again.
Inspection focus
- Just paraphrasing: what most readers do
- Frequently there are no detailed, written specifications.
- So reader paraphrases line-by-line, starting
with line 1 and continuing to the end.
- Other inspectors speak up when they hear
something that seems wrong.
- Specialized roles for inspectors
- To focus on commonly occurring problems, such as:
coding conventions,
common failures,
standard techniques, and
portability.
- In one AT&T inspection team,
there was an inspector focused solely on C macros.
CSCI 265 focus
- We do have specifications and so can inspect for
"correctness with respect to the specification".
- Correctness of exported functions
with respect to the module interface specifications.
- Correctness of local functions
with respect to header comments.