Static testing: reviews, walkthroughs and inspections
Static testing (reviews, walkthroughs, inspections) finds defects early by examining work-products without running code, using structured or informal meetings with defined roles and checklists.
Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
Static testing is used by engineers to find defects early, before execution, saving project time and cost. Reviews, walkthroughs and inspections improve product quality, reduce rework during later testing levels (unit, integration, system, acceptance) and support traceability and standards compliance.
Key ideas
Review: a general term for a meeting or activity where stakeholders examine a work-product to identify problems and improvements. Assumption: participants have relevant knowledge of the product and standards.
Walkthrough: an informal, author-led review in which the author guides participants through the artifact to explain intent and invite feedback. Characteristic: learning and clarification are primary goals; defects may be noted but not necessarily logged formally.
Inspection: a formal, structured review with defined roles, entry/exit criteria, documented records, and explicit defect logging. Inspections are based on a standard process (commonly the Fagan inspection model).
Fagan-style inspection (exact process steps universities expect) State the process as a sequence of phases with definitions and assumptions: planning → overview (optional) → preparation → inspection meeting → rework → follow-up (verification).
- Planning: select artifact, define scope and participants, schedule. Assumption: artifact is ready for review (meets entry criteria).
- Overview: (optional) introduce artifact to reviewers. Assumption: reviewers may need context.
- Preparation: individual reviewers read the artifact and note defects using a checklist. Assumption: reviewers have time and the checklist.
- Inspection meeting: moderator leads a focused meeting to collect and classify defects. The meeting does not try to solve design problems deeply; it focuses on identifying defects. Assumption: defects are discussed, not resolved in meeting (except minor clarifications).
- Rework: the author corrects defects found and records changes.
- Follow-up: moderator or designated person verifies that corrections were made and that exit criteria are met.
Roles in a formal inspection (define each; exams expect these names)
- Author: person who produced the artifact; answers questions and reworks defects.
- Moderator (or Leader): organiser who schedules, enforces process and runs the inspection meeting.
- Reader: walks the group through the artifact during the meeting (sometimes the moderator or a reviewer acts as reader).
- Reviewers (Inspectors): examine the artifact in preparation and at the meeting to find defects.
- Recorder (Scribe): logs defects and action items during the meeting.
Checklists and measures
- Checklist: a prepared list of items to inspect (coding standards, boundary conditions, API contracts, traceability to requirements). A checklist improves consistency and coverage.
- Defect: any deviation of the artifact from its specification, standard, or stakeholder expectation. Assumption: a defect is logged and tracked until closure.
- Entry criteria: conditions a work-product must satisfy before review (e.g., a unit test suite exists, document version controlled).
- Exit criteria: conditions that define when the review is complete (e.g., all high-priority defects fixed and verified).
Assumptions behind static testing effectiveness
- People can reliably find defects in documents without executing code when given time and checklists.
- Formality (inspections) increases defect detection rate and provides metrics for process improvement; however, inspections cost time and need trained participants.
When to use which
- Use walkthroughs to teach, get early feedback, or clarify complex designs.
- Use inspections when high reliability is required, when regulatory compliance is needed, or when you must measure and report defect metrics.
- Use reviews (ad hoc or checklist-driven) during normal development as a lighter-weight alternative.
What to draw (diagrams exams ask for)
- Draw an inspection flowchart: a sequence of boxes left-to-right or top-to-bottom labeled "Planning" → "Overview" → "Preparation" → "Inspection Meeting" → "Rework" → "Follow-up". Add arrows for possible loops from "Follow-up" back to "Rework" if verification fails. Label roles near the boxes (Moderator, Author, Reviewers, Recorder).
- Draw a roles table: columns "Role" and "Responsibility" and list Author, Moderator, Reader, Reviewers, Recorder.
Formulas
Defect density = (Number of defects found) / (Size of work-product) where size is usually KLOC (thousand lines of code) or pages. Unit: defects / KLOC or defects / page. Applies when comparing defect concentration across modules.
DRE (%) = (Defects found during reviews and testing) / (Total defects injected) × 100 where Total defects injected = defects found during reviews + defects found later in field. Unit: percent. Use when estimating how many defects were removed before release.
DRE (%) = (N_found_before_release) / (N_found_before_release + N_found_in_field) × 100 symbols: N_found_before_release = defects found by reviews+tests, N_found_in_field = defects found after release. Unit: percent.
Preparation rate (pages/person-hour) = (Pages inspected) / (Total individual preparation effort in person-hours) Unit: pages per person-hour. Inspection meeting rate (pages/hour) = (Pages inspected) / (Inspection meeting duration in hours) Unit: pages·h⁻¹. Use preparation rate to plan prep effort and meeting rate to plan meeting time.
Note: where organisations use different size metrics (function points, classes), replace KLOC with those units.
Worked examples
- Numerical: compute defect density and DRE Given: A module of 25 KLOC. During inspections and testing before release, 120 defects were found. After release, customers reported 30 defects. Compute defect density and DRE. Steps:
- Formula for defect density:
Defect density = Number of defects / Size. Here use total defects found before release (120) or total discovered ever (120+30=150) depending on purpose. If comparing pre-release quality, use pre-release defects. - Using pre-release defects:
Defect density = 120 / 25 = 4.8 defects/KLOC. - DRE formula:
DRE = N_found_before_release / (N_found_before_release + N_found_in_field) × 100. - Plug numbers:
DRE = 120 / (120 + 30) × 100 = 120 / 150 × 100 = 80 %. Answer: Defect density = 4.8 defects/KLOC; DRE = 80%.
Theory / long question model answer: "Explain inspection roles, process and why inspections are effective" Model answer (short version expected in exams): Define inspection as a formal review process with entry/exit criteria. List roles (Author, Moderator, Reader, Reviewers, Recorder) and describe duties. State the six inspection phases (Planning, Overview, Preparation, Inspection meeting, Rework, Follow-up) and explain each briefly. Explain effectiveness: inspections find defects early (cheaper to fix), enforce standards, produce metrics (defect density, DRE). Mention limits: inspections require trained people and time, cannot find runtime defects that only appear under execution.
Step-by-step trace of a small walkthrough Artifact: a 4-function pseudo-code file. Author presents each function for 5 minutes; reviewers ask clarifying Qs and note defects. Trace: Step 1: Author explains function A — reviewers note missing error-check for null input. Step 2: Function B — reviewer spots off-by-one loop boundary. Step 3: Meeting ends; author lists two defect fixes and estimated rework time. Follow-up: moderator schedules verification after fixes.
Common mistakes
- Confusing defect density units: always state the size unit (defects/KLOC or defects/page). Do not omit K in KLOC.
- Thinking inspections find runtime-only defects (they cannot find defects that require execution to reveal e.g., race conditions unless design reveals them).
- Not stating or using entry/exit criteria when describing an inspection process.
For your exam
Typical question types
- Definitions and short notes: define static testing, reviews, walkthroughs, inspections, list roles and checklist items.
- Derivations/explanations: show inspection phases, argue why inspections reduce cost of quality, derive DRE and compute values.
- Diagrams: draw inspection flowchart and label roles — include arrows showing rework and follow-up loops.
- Numericals: compute defect density, DRE, interpret results. What full-marks answers include
- Clear definitions with bold term names (if writing by hand, underline or capitalise them).
- Explicit list of phases and roles with responsibilities.
- A labeled flowchart when asked for process diagrams.
- Correct formulas with units and step-by-step numerical calculations showing substitution and units.
- Mention of practical considerations: checklists, entry/exit criteria, time estimates, training requirement.
Quick check
- What is the primary difference between a walkthrough and an inspection?
- Write the DRE formula (percentage) and explain the symbols.
- Name three roles in a formal inspection and one responsibility of each.
Answers: 1) Walkthrough is informal and author-led; inspection is formal, structured and records defects. 2) DRE (%) = N_found_before_release / (N_found_before_release + N_found_in_field) × 100, where N_found_before_release = defects found by reviews and tests before release, N_found_in_field = defects found after release. 3) Author — fixes defects; Moderator — runs and enforces the process; Recorder — logs defects and action items.
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?