Artificial Intelligence & Data Science is coming soon

We're still writing and reviewing the notes for every subject, and we'll open it when every subject is ready. Meanwhile you can practise aptitude, ask Aria about any subject, or see the branches that are ready.

Test planning and test strategy

Practical study notes on Test Planning and Test Strategy: definitions, laws, metrics, worked examples, common mistakes and exam guidance for undergraduate computer engineering students.

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

Test planning and test strategy let engineers decide what to test, how to test, who will test and when. Good plans reduce wasted effort, find more defects earlier, and connect testing to quality goals engineers use during project design, implementation and release.

Key ideas

Start by defining terms in plain English.

  • Test plan: a formal document that records the scope, approach, resources and schedule of intended test activities. It answers who, what, when, where and how much for testing. (Use this term throughout tests and project audits.)
  • Test strategy: a high-level document or section that describes the testing approach for the whole organization or project family — it sets principles and policies (for example, “we use risk-based testing first” or “automate regression for releases”).
  • Test case: a set of inputs, execution conditions and expected results, developed for a particular objective such as to exercise a particular program path or verify a requirement.
  • Test scope: the features and combinations to be tested and the features excluded. Define scope before tasking resources.
  • Test schedule: a timeline for test activities, linked to development milestones and release dates.
  • Entry criteria: conditions that must be true before testing starts (for example, "unit tests passed and build is stable").
  • Exit criteria: conditions that mark test completion (for example, "all high-severity bugs fixed or mitigated; test coverage > 80% of planned cases").
  • Suspension/resumption criteria: conditions under which testing is paused (e.g., blocking defects, unstable build) and the requirements to resume (e.g., fixes verified, environment restored).
  • Risk-based testing: selecting tests based on the probability and impact of failure; high-risk areas are tested earlier and more thoroughly.
  • Test risks and contingencies: identified risks to testing (e.g., environment unavailability, schedule slippage) and planned mitigations/contingencies.
  • Test environment: hardware, software, network and test data needed to run tests; document exact versions and configurations.
  • Test deliverables: test plan, test cases/scripts, test data, defect reports, daily/summary reports and a test closure report.
  • Test metrics: measurable indicators used to monitor testing (examples: executed tests, pass rate, defect density, test coverage, DRE).
  • Requirements Traceability Matrix (RTM): a mapping from requirements to test cases and defects to ensure coverage and support impact analysis.

Exact statements and assumptions commonly required in exams:

  1. Definition statement (formal): "A test plan is a document specifying the objectives, resources and schedule for testing activities, with defined entry and exit criteria." Assumption: project has defined requirements and a build process.

  2. Risk-based testing principle (formal): "When resources are limited, allocate testing effort proportional to risk = probability × impact; test highest-risk features first." Assumption: you can estimate probability and impact before full testing.

  3. DRE (Defect Removal Effectiveness) principle (formal): "DRE = defects removed before release / total defects, where total defects = defects removed before release + defects found after release." Assumption: defects after release can be measured and linked to the release.

Diagrams to draw (exam instruction):

  • V-model showing where test planning fits: Draw a large letter 'V'. Left descending side label: Requirements → System Design → Architecture → Module Design. Right ascending side label: Unit Test (opposite Module Design), Integration Test (opposite Architecture), System Test (opposite System Design), Acceptance Test (opposite Requirements). At the top ends, the left start is 'Requirements' and the right end is 'Acceptance'. At the bottom between the sides label 'Implementation/Coding'. Annotate that Test Plan and Test Strategy are created at the start and updated through the V.
  • Test strategy flowchart: Draw boxes left to right labelled "Scope" → "Approach (manual/automated, levels)" → "Resources & Roles" → "Environments & Tools" → "Schedule" → "Entry/Exit Criteria". Draw arrows left-to-right.

Formulas

Test coverage (%) = (Number of executed test cases / Number of planned test cases) × 100 — Number of tests counted, unit: percent (%), applies when you have defined planned tests.

Pass rate (%) = (Number of passed tests / Number of executed tests) × 100 — unit: percent (%), applies to executed tests only.

Defect density = Number of defects found / Size — Size typically in KLOC (thousand lines of code) or function points; unit: defects/KLOC or defects/function-point, applies when measuring defects per size.

DRE = (Defects removed before release) / (Defects removed before release + Defects found after release) × 100 — unit: percent (%), applies when post-release defects are tracked and attributable.

Test effectiveness (simple) = (Number of defects found by testing) / (Total defects discovered by testing + by customers) × 100 — unit: percent (%), similar to DRE.

Note on units: most metrics here are percentages or counts; defect density has units (e.g., defects/KLOC or defects/function-point). When using KLOC include KLOC as the denominator unit for defect density.

Worked examples

  1. Numerical: Test coverage, pass rate and DRE Problem: A release has 500 planned test cases. Test team executed 420 tests; 360 passed, 60 failed. Before release testers found 90 defects and fixed 85. After release customers reported 15 defects that were traced to this release. Compute test coverage, pass rate and DRE. Steps:
  • Formula: Test coverage = (executed / planned) × 100 Numbers: executed = 420, planned = 500 Calculation: (420 / 500) × 100 = 0.84 × 100 = 84% → Test coverage = 84%
  • Formula: Pass rate = (passed / executed) × 100 Numbers: passed = 360, executed = 420 Calculation: (360 / 420) × 100 = 0.857142... × 100 = 85.714...% → Pass rate ≈ 85.71%
  • For DRE: defects removed before release = 85 (fixed by testers before release). Defects found after release = 15. Formula: DRE = before / (before + after) × 100 Calculation: 85 / (85 + 15) × 100 = 85 / 100 × 100 = 85% → DRE = 85%
  1. Model-answer: short exam question: "Write a test strategy for a small online bookstore project (basic web app)." Answer (step-by-step, writeable in 8–12 lines):
  • Scope: test login, browsing, search, cart, checkout, payments (excluded: admin analytics in first release).
  • Approach: combination of functional black-box tests (system-level) and regression automation for core flows (login, checkout). Unit tests required for new modules.
  • Levels: unit, integration, system, acceptance. Prioritise system tests for payment and order flows.
  • Risk-based selection: payment gateway and order processing as high risk; assign 40% of effort.
  • Resources & roles: 2 testers for manual, 1 automation engineer, 1 test lead.
  • Environments: Dev, QA (staging), UAT, and Production; use masked production-like data in QA.
  • Tools: Selenium for UI automation, JMeter for simple performance checks, Postman for API tests.
  • Entry criteria: stable build, unit tests passed, database migration complete.
  • Exit criteria: all critical defects closed, pass rate > 95% for smoke, test coverage of planned cases > 80%.
  • Deliverables: Test plan document, test cases, test summary report, defect log.

This answer must be concise but explicit about scope, approach, resources and criteria.

Common mistakes

  • Reporting percentages without showing numerator/denominator (e.g., saying "coverage 90%" but not stating how many tests planned/executed).
  • Using DRE without confirming post-release defects are attributed to the same release.
  • Saying "automate all tests" — unrealistic; instead show prioritisation (what to automate and why).
  • Not describing the test environment configuration (OS, DB, versions). Examiners penalise missing details.

For your exam

Typical question types:

  • Definitions: define test plan, test strategy, entry/exit criteria — include a short example.
  • Short notes: write a test strategy for X, list components of a test plan.
  • Derivations: derive DRE and explain assumptions; show algebra and sample calculation.
  • Numericals: compute coverage, pass rate, defect density, DRE from given numbers (show steps).
  • Diagrams: draw the V-model and label where test planning and test strategy belong.

What a full-marks answer includes:

  • Clear definitions (bold the term if asked), explicit assumptions, and one concrete example.
  • For plans/strategies: include scope, approach, levels, resources, environment, tools, schedule, entry/exit criteria, and suspension/resumption criteria.
  • For numericals: list formulas, substitute numbers, carry units (percent), show final answer in bold.
  • For diagrams: draw simple labelled shapes as described in Key ideas and explain each label in one line.

Quick check

  1. What is the difference between a test plan and a test strategy?
  2. Write the DRE formula and explain what it measures.
  3. Name three items that must appear in a test plan. Answers: 1) Test strategy = high-level policy; test plan = project-specific schedule and resource document. 2) DRE = before / (before + after) × 100 measures the percentage of defects removed before release out of total defects. 3) Scope, entry/exit criteria, resources/schedule (any three of scope/approach/resources/environment/tools/schedule/criteria).

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?