The Art of Software Testing
Chapter 3: Program Inspections, Walkthroughs, And Reviews
Glen Myers
Wiley
Third Edition, 2012
Inspection -- the concept of reading and studying program code as part of a testing effort -- is widely accepted
Human testing techniques are quite effective in finding errors
In this course, we will use only Inspections (somewhat different from those described by Myers) and
not Walkthroughs and Reviews
Inspections contribute substantially to productivity and reliability
The earlier errors are found, the lower the costs of correcting the errors and the higher the
probability of fixing them correctly
Inspections involve a team of people reading a Project Charter, Product
Backlog, Test Plan, Design Document, or source code
Participants must conduct some preparatory work
The objective of the Inspection meeting is to find errors, but not to find solutions to the errors
Only one of the participants is the author
Therefore, the majority of testing is conducted by people other than the author (Chapter 2: principle 2)
This process frequently exposes a batch of errors, allowing the errors to be corrected later en masse
Human testing methods generally are effective in finding a lot of design and coding errors in typical
software
Difficult, obscure, or tricky errors are more often found by testing
Inspections and testing are complementary
Error detection efficiency will suffer if one or the other is not present
Modifications also should be subjected to Inspections
Inspection Team
Usually consists of 4-6 people
Moderator
Schedules and runs the meeting
Ensures that defects are subsequently corrected
Author
Describes the item (design or code), statement by statement
Recorder
Records all defects found
Inspection Agenda
Moderator distributes the item to the other participants
Participants are expected to familiarize themselves with the material prior to the session
During the session, author narrates the item statement by statement
Other participants should raise questions, which should be pursued to determine whether defects exist
Simple act of reading aloud an item to an audience seems to be a remarkably-effective error
detection technique
Moderator is responsible for ensuring that discussions proceed along productive lines and that the
participants focus their attention on finding errors, not correcting them
Author corrects errors after the inspection session
If more than a few errors were found, or if any of the errors require a substantial correction,
moderator will make arrangements to reinspect the item after those errors have been corrected
Can incorporate the use of a small set of test cases -- representative sets of inputs (and expected
outputs) for the code
During the meeting, each test case is mentally executed
Test data are "walked through" the logic of the program
Test cases serve as a vehicle for getting started and for questioning the programmer about his or
her logic and assumptions
In most inspections, more errors are found during the process of questioning the programmer than are
found directly by the test cases themselves
Comments should be directed toward the item rather than the author
Errors should NOT be regarded as weaknesses in the person who committed them
Rather, they are viewed as inherent to the difficulty of software development
Optimal amount of time for inspection session is from 1 to 2 hours
Human Agenda
For the inspection process to be effective, the participants must adopt an appropriate attitude
If the author views the inspection as an attack on his or her character and adopts a defensive
posture, the process will be ineffective
Author must keep in mind that the objective of the inspection is to find errors and to improve the
quality of the work
Side Benefits of the Inspection Process
In code inspections, author usually receives valuable feedback concerning programming style, choice
of algorithms, and programming techniques
Other participants gain by being exposed to another author's errors, programming style, choice
of algorithms, and programming techniques
Inspection process is a way of identifying early the most error-prone sections of the project,
helping to focus attention more directly on these sections during the computer-based testing
processes
Last Word
Inspections remain as one of the last bastions of real, in-person, non-virtual, non-electronic interactions among software engineers!
But even this is breaking down with the increase of virtual inspection meetings....