Inspection examines software without execution. A form of static V&V. May be applied to any representation of the system: requirements, design, configuration data, test data, etc.
Can be applicable even on incomplete systems. No execution cost. Can uncover chains of errors.
Can only be used for verification, not validation. Cannot check non-functional characteristics such as performance or usability.
Defect Categories
- Data faults
Uninitialized variables, wrong array bounds, type mismatches. - Control faults
Incorrect conditions, missing break statements, infinite loops. - I/O faults
Incorrect format specifiers, missing file closures. - Interface faults
Wrong parameter types, incorrect counts, mismatched assumptions. - Storage management faults
Unfreed memory, corrupt pointers. - Exception management faults
Missing or wrong exception handlers.
Inspection Roles
- Author
Created the artifact under review. Present to clarify intent, not to defend. - Inspector
Examines the artifact and raises issues. Multiple inspectors may participate. - Reader
Narrates the artifact aloud, paraphrasing rather than reading verbatim. - Moderator (Chair)
Runs the meeting, enforces the agenda, ensures issues are logged, not resolved during inspection. - Recorder
Documents every issue raised, its type, and its location.
Fagan Inspection Process
Fagan inspection is the formal, structured variant developed by Michael Fagan at IBM.
6 phases in order:
- Planning
Moderator selects team, distributes materials, schedules meeting. - Overview
Author presents the artifact to all participants to establish context. - Preparation
Each inspector studies the artifact individually, noting potential defects using checklists. - Inspection meeting
Reader narrates; inspectors raise issues; moderator logs them. No fixing occurs during this phase. - Rework
Author corrects all logged defects. - Follow-up
Moderator verifies that rework is complete and satisfactory. May trigger re-inspection.
Checklists
Checklists guide inspectors toward known defect-prone areas. Specific to language and artifact type.
Examples for code inspection:
- Are all variables initialized before use?
- Are array indices within bounds on every access?
- Are all allocated resources freed on every exit path?
- Are all exception cases handled?
- Does every method validate its input preconditions?