STAFFCHAPTER 26

A test strategy for a product

A strategy is an argument with evidence: the risks, the cheapest level that covers each, what you leave out, and numbers you can re-measure

55 MINSOFTWARE TESTING AND QUALITYUPDATED 2026-11-24
PREDICT

Djibril has two days to answer the director. Which first step gives the most reliable answer?

A test strategy answers four questions for a product: what could go wrong, which kind of test is meant to catch each thing, what is deliberately left alone, and how you will know the answer is still true next quarter. It is short. It is also an argument, so every sentence in it should be something you could be asked to defend, and defend with a command that prints a number.

The word is used loosely. In an organisation it can mean a policy document, a slide, or a wiki page nobody opens. Here it means one page in the repository next to the code, reviewed in pull requests like the code. The QA track has chapters on the role side of this: the QA track chapter Test strategy and plans (careers, QA) covers writing it for stakeholders and how it differs from a plan, Release management and sign-off covers who decides to ship, and Testing philosophies compares the schools of thought. This chapter owns the craft: how to build the page from the lab’s own evidence.

Start from risk, not from the tool list

Most strategies start from what the team has: a unit framework, a browser tool, a CI system. That produces a description of the toolchain. Start instead from how the product fails, and rank the failures by how much they cost.

James Bach’s Heuristic Test Strategy Model (version 6.3, December 2024) is a checklist for this. It splits the thinking into project elements (who, what time, what tools, what information you have), product factors (structure, functions, data, interfaces, platform, operations, time) and quality criteria (capability, reliability, security, performance and so on). You do not copy it. You use its guide words to ask the questions you forgot. The product factor “time” is what reminds you to ask about promotions that start at midnight, and “data” is what reminds you that 1,000,000 kobo is a boundary.

For checkout you do not need a workshop to find the risks, because the earlier chapters have already produced a list. Each of these came from something you ran:

Failure class Where you met it What it looks like in checkout
Boundary Choosing test cases A discount that starts at ₦10,000 but is coded as above ₦10,000
Arithmetic and rounding Testing money VAT at 7.5% rounded the wrong way on a half kobo
Time zone and date Testing time, randomness and concurrency A promo valid on Lagos days, read in UTC
Contract drift API and contract tests, Fakes, stubs and mocks The provider changes a field and the mock still says the old one
Dependency failure Testing across services Provider down, slow or declining: is the order paid, lost or doubled?
Concurrency Testing time, randomness and concurrency Two requests with one idempotency key both create an order
Authorisation Security testing A seller sees another seller’s draft product in search
The suite lying Flaky tests, Coverage and mutation testing A test that sleeps, or one that asserts nothing

The last row is the one strategies leave out. A suite is part of the product’s safety system, and it can fail in its own ways: flaky, slow, or green because it checks nothing. Treat it as a risk with a measurement, as the next sections do.

Rank the rows. Likelihood times impact is enough, with three levels of each. A rounding error on every order is likely and costs money on every sale. A seller sees a draft once, which is unlikely and an embarrassment. Money, stock and duplicate orders go at the top. The ranking decides where the expensive tests go, and it is worth writing the reason next to the rank, because that is the part the next lead will argue with.

One level per risk: the cheapest that can fail

A risk needs a test that goes red when the risk is real. Several levels could do it. The rule for choosing is cost: use the cheapest level that can fail for that cause.

The shape of a suite measured what each level costs: in the lab, ten unit tests run in about 0.1 s and six integration tests in about 0.4 s, and one browser test costs more than all sixteen together. A boundary is a function of two numbers, so a unit test checks it in a millisecond. Contract drift lives between two programs, so it needs a check against fake_provider/contract.json, not a unit test with a mock that agrees with itself (API and contract tests and Fakes, stubs and mocks). A race needs two threads and a real file, so it is an integration test (Integration tests with a real database). A visual bug needs a browser, and you pay for one.

Toby Clemson’s account of testing microservices names the same ladder: unit, integration, component, contract and end-to-end tests, each aimed at a different boundary. Two ideas from it matter here. A service is tested alone first, with its neighbours replaced by test doubles. And contract tests are what keep those doubles honest.

The Google SRE book makes a different point about where tests sit in reliability. It argues that a bug found by a test that can block a release has, in its words, zero mean time to repair, because it never reaches users. That is the real reason to put a risk under a test and not only under a dashboard: monitoring finds a fault after a customer has met it. Not every risk can be tested before release. Some can only be seen in production, and for those the strategy names the production check, for example a synthetic order, so that the row is not left empty. Testing in production, later in this module, builds that check.

Record each row as three cells: the risk, the level, the evidence. The evidence cell is the one that stops this being decoration. It names the thing you ran that shows the risk is currently covered or currently not. For a boundary risk the evidence can be a mutation survivor: the >= to > mutant in discount_bp is alive in the starter suite, which means the strategy’s own row says “covered at unit level” while the evidence says it is not. That is the point. A strategy that lists the gaps its evidence shows is more useful than one that claims everything is covered, and it gives the team its first tickets.

Say what you will not test

The most honest section of a strategy is the one listing what is left out. Every suite leaves things out. If the page does not say which, a reader assumes everything is covered, and the first escape confirms that nobody decided.

Each item needs its reason and, where it exists, what stands in for the test. For checkout:

  • Page layout and styling. One browser test walks the order flow. A mis-aligned button costs a patch release, and a pixel test of every state costs a day a month in maintenance.
  • The fake provider’s internals. It is a test double. What matters is that its responses match contract.json, which is checked.
  • The real provider. Nothing here calls it. A real call costs money, needs credentials, and is flaky for reasons you do not control. Its behaviour is checked in production with a synthetic order.
  • Capacity beyond the load test. The suite makes no claim about peak traffic.

Notice what these have in common: low impact, high cost to test, or a better detector elsewhere. A reason of “we ran out of time” is allowed, but write it down as that, since it is a debt and someone should be able to find it. Reviewers often learn more from this list than from the risk table, because it shows how the author thinks about cost.

The same section is where you record the quarantine. The lab’s flaky test is deselected by default (addopts = -m 'not flaky'). That is a decision the strategy should hold: one test, an owner, and a deadline, or it becomes a place where tests go to be forgotten (Flaky tests).

Environments and data

A strategy that does not say where tests run and on what data cannot be reproduced, and flaky tests live in that gap. Four things to state:

  1. Where each level runs. Unit and integration tests run on a laptop and in CI with no network. The smoke test starts both apps, checkout on 8094 and the provider on 8095, with its own temporary database. The browser test needs Chromium and is skipped without it, so the strategy says whether CI installs it.
  2. What state they start from. In the lab every test builds its own sqlite file (the db fixture) and its own clock (FakeClock at 2026-11-23 09:00 UTC). No test reads another’s data (Test data and fixtures).
  3. What is real and what is faked. The payment provider is always the fake. The database is always real sqlite, since mocking the database would hide the races the strategy lists.
  4. What data is allowed. Seed data and generated data only. Nothing copied from production, because Ojaline’s customers’ names and cards do not belong in a test database.

If your environments differ (a shared staging database, a sandbox account at the provider) the strategy lists each with its owner and its known flaws. A shared environment is a risk row of its own.

Exit criteria that can be measured

An exit criterion answers: what must be true before this change merges, or this release ships? Write each as a gate that a script can check. Four of the five the lab’s strategy uses are numbers you have already met:

  • Suite time under two minutes. From the project: if the check takes longer, people stop running it.
  • A coverage floor. The lab’s CI gate is 60% on unit plus integration. Whole-package coverage in the starter suite is 80%. A floor catches new code with no tests. It does not measure protection (Coverage and mutation testing).
  • A mutation score on the money rules. pricing.py scores 41% in the starter suite. The gate starts at 40 so that today’s suite passes, and rises as you kill survivors. Read beside coverage it is the check on whether the coverage means anything.
  • No flaky failures in 50 random-order runs of the default suite.
  • At most one test in quarantine.

Two cautions. First, a gate is a number that people will optimise. When a number gates a merge, the cheapest way to meet it is the one that does not improve the product (the Goodhart effect the coverage chapter showed). Pair each gate with a harder measure of the same thing, and review survivors by hand in the pull request instead of chasing a score. Second, 50 runs is a small sample. If the default suite fails 0 times in 50, the true failure rate could still be as high as about 3 in 50, which is 6%, at 95% confidence (the rule of three). Fifty runs can expose a flake that fails half the time, and cannot clear a suite that fails one run in 30. The strategy says so, and says how often the check runs in CI, where hundreds of runs accumulate for free.

▶ SIMULATION
WHAT THE TEAM SEES
build: not run
time: 25 min
attempts on the sleep test: -
retries: auto x3, failures discarded
WHAT IS TRUE
discount off by one at 10000: in the code
payment mock drifted from the real response: in the code
order write races the inventory read: in the code
bugs shipping under a green build: -
last-
✓ the build is red exactly when the code is wrong✓ every bug in the code is named by a failing test✓ no failed attempt is thrown away
SCHEDULE
01[CI]CI runs the suite
02[CI]report
Start of the green suite scenario. 2 steps.
// the suite the team trusts
test('discount', () => expect(discount(5000)).toBe(0));   // middle values only
test('pays', () => expect(parse({ status: 'succeeded' }).paid).toBe(true)); // hand-written mock
test('stock', async () => { place(order); await sleep(2000); expect(stock()).toBe(9); });
// CI: retry failed tests x3, keep the last result

The simulation puts the whole argument in one place. The suite is green and three real bugs sit in the service: a boundary, a drifted mock and a race. Watch which suite change makes the build red for which bug, and how long the run takes in each case. Change one thing at a time. Edge tests catch the boundary and say nothing about the drift. A contract check catches the drift and misses the race. Retries turn the race into a pass. What it proves is that no single number says a suite is good. A strategy is the list of which checks answer which questions.

Ownership and review

A strategy with no owner is a draft. Name who owns the page, who owns each level’s health and who owns the things the suite touches but the team does not: the provider contract, the fake, the pipeline. Name the review date, and the events that force a review early. The one that matters most: an escaped bug. Each escape tells you the strategy was wrong about something. The response is a test at the cheapest level that could have caught it, and a correction of the risk row, so the page learns.

Keep the page to about one screen. Seven sections are enough: scope, risks, levels, not tested, environments and data, exit criteria, ownership. A longer strategy is not read, and a strategy that is not read is not a strategy. Put long reasoning in linked notes and keep the page for decisions.

Where strategies go wrong

  • The template with no numbers. Every section is present and every claim is a sentence. Nobody can tell whether it is true. Fix: each risk row names a command whose output supports it.
  • A strategy of one level. “We do end-to-end testing” or “we have 90% unit coverage”. Each level has blind spots, and the capstone simulation shows what slips through.
  • The aspiration. The page describes the suite the team wishes it had. Fix: say what exists now, mark what is planned with a date and an owner.
  • No cost. Risks and no price: nothing says what the tests cost to run and keep. Put time and count in the levels table.
  • No change. The page is written once for an audit. Review it every quarter and after every escape.
  • Strategy by committee. A strategy written by one person for approval by others turns into a list of everything anyone asked for. Choose and cut.
LAB Write the strategy for the checkout service, with evidence ~50 MIN
YOU NEEDPython 3.9 or laterlabs/testing set up with its .venv (see its README)A clone of the lab you may editAbout five minutes of waiting: the script runs the suite 100 times

You will measure the suite with one script, read the weak spots the numbers show, write STRATEGY.md in the lab, and check it with a second script that compares its exit criteria with what you measured. The numbers below came from the clean starter lab on 2026-11-24. If you did the earlier labs, your suite has more tests and better scores: your numbers should be higher where you killed survivors. Work from labs/testing. Point the database at a scratch file so nothing touches data/:

cd labs/testing
export CHECKOUT_DB=/tmp/strategy-lab.sqlite

If something already holds 8094 or 8095, the smoke test inside check.sh fails to start. Check with lsof -i :8094 -i :8095, and set SMOKE_API_PORT and SMOKE_PROVIDER_PORT to free ports for the run. The strategy still names 8094 and 8095.

1. Write the evidence script. Create scripts/evidence.sh, make it executable (chmod +x scripts/evidence.sh) and run it. It takes the four measurements the strategy leans on and writes them as key: number lines to evidence.txt. The mutation step deletes mutants/ first so an old cache cannot give you an old picture. It takes about two minutes, almost all of it the 100 runs.

#!/bin/bash
# scripts/evidence.sh: measure the suite and write evidence.txt. Run from anywhere.
cd "$(dirname "$0")/.." || exit 1
export TZ=UTC
export CHECKOUT_DB="${CHECKOUT_DB:-/tmp/strategy-lab.sqlite}"
PY=.venv/bin/python
OUT=evidence.txt
echo "# measured $(date -u +%Y-%m-%dT%H:%MZ) on $(uname -s)" > "$OUT"

# E1: wall time of the whole check (suite plus smoke test)
secs=$( { time -p ./scripts/check.sh >/dev/null 2>&1; } 2>&1 | awk '/^real/ {print $2}')
echo "suite_seconds: $secs" >> "$OUT"

# E2: line and branch coverage of the whole package
cov=$($PY -m pytest -p no:randomly --cov=checkout --cov-branch -q 2>&1 | awk '/^TOTAL/ {gsub("%","",$NF); print $NF}')
echo "coverage_pct: $cov" >> "$OUT"

# E3: mutation score on pricing.py (the file mutate.py is configured for)
rm -rf mutants
last=$($PY scripts/mutate.py run 2>&1 | tr '\r' '\n' | grep '🎉' | tail -1)
killed=$(echo "$last" | sed -E 's/.*🎉 ([0-9]+).*/\1/')
total=$(echo "$last" | sed -E 's/.* ([0-9]+)\/([0-9]+) .*/\2/')
echo "mutation_pricing_pct: $((100 * killed / total))" >> "$OUT"
echo "mutants_killed_of_total: $killed of $total" >> "$OUT"

# E4: flake rate. The default suite 50 times in random order, then the
# quarantined example 50 times.
fails=0
for _ in $(seq 50); do
  $PY -m pytest -q >/dev/null 2>&1 || fails=$((fails + 1))
done
echo "suite_failures_of_50: $fails" >> "$OUT"
fails=0
for _ in $(seq 50); do
  $PY -m pytest -m flaky -p no:randomly -q >/dev/null 2>&1 || fails=$((fails + 1))
done
echo "quarantined_failures_of_50: $fails" >> "$OUT"
echo "quarantined_tests: $($PY -m pytest -m flaky --collect-only -q 2>/dev/null | grep -c '::')" >> "$OUT"
cat "$OUT"
./scripts/evidence.sh
# measured 2026-11-24T00:00Z on Darwin
suite_seconds: 2.31
coverage_pct: 80
mutation_pricing_pct: 41
mutants_killed_of_total: 28 of 68
suite_failures_of_50: 0
quarantined_failures_of_50: 25
quarantined_tests: 1

The whole check takes about 2 s (your figure differs by machine). Coverage of the package is 80% and 41% of the injected faults in pricing.py are caught: 28 of 68. The default suite failed 0 of 50 random-order runs. The quarantined test failed 25 of 50 in this one run. Over every run of 50 taken while writing the course it failed about 35% to 60% of the time, varying from run to run, so expect a rate in that range and do not quote it more precisely from 50 runs. The timestamp is whatever your clock says.

2. Read the weak spots. The numbers say how much; these say where. List where the injected faults survive and which files have the least coverage:

.venv/bin/python scripts/mutate.py results | sed 's/.*pricing\.x_//;s/__.*//' | sort | uniq -c
.venv/bin/pytest -p no:randomly --cov=checkout --cov-branch --cov-report=term-missing -q 2>&1 | grep -E "legacy|payments_client|inventory|api.py"
   6 delivery_fee
   1 discount_bp
   5 line_total
  25 price_cart
   3 promo_applies
checkout/api.py                  83     22      4      0    72%   52-54, 61-62, 73, 75, 77, 80, 84-87, 91, 95, 101-113
checkout/inventory.py            18      4      6      1    79%   10-11, 23-24
checkout/legacy.py               20     20      8      0     0%   4-24
checkout/payments_client.py      26     14      4      0    40%   28, 31-47

The survivors cluster in the money rules, where the strategy wants its strongest tests. payments_client.py at 40% is the code that talks to the provider, and its timeout and error handling are the lines no test reaches. Each of these is a row for the risk table or an item for the not-tested list. Add yours as you go.

If you did the earlier labs your survivor counts are lower. Use your own output, not this page’s.

3. Price the levels. The strategy’s levels table needs the cost of each tier. Count and time them as in the shape chapter:

for d in unit integration e2e; do echo "== $d"; .venv/bin/pytest tests/$d -q -p no:randomly 2>&1 | tail -1; done
== unit
10 passed in 0.09s
== integration
6 passed in 0.35s
== e2e
1 skipped in 0.34s

Ten fast unit tests, six integration tests that cost four times as much between them, and a browser test that is skipped without Chromium. These are the Tests and Time columns. Yours will differ if you added tests.

4. Write the strategy. Create STRATEGY.md in labs/testing. The file below is a worked version for the starter lab. Replace the numbers and rows with what steps 1 to 3 showed for your suite, keep the seven headings, and keep it to one page. The checker reads the headings, the Risks table, the Not tested bullets, the gate: lines and the word “owns”.

# Test strategy: Ojaline checkout service

Owner: the checkout team. Reviewed: 2026-11-24. Next review: 2027-02-24, or after any escaped bug.

## Scope

Checkout prices a cart, reserves stock, charges the payment provider and writes the order. This strategy covers that service and its fake provider. It does not cover the marketplace, search ranking or the seller wallet. The goal: a change that breaks money, stock or a duplicate order cannot reach customers without a red test, and the suite stays fast enough that people run it.

## Risks

| Risk | Level | Evidence |
|---|---|---|
| Wrong discount tier at exactly ₦10,000 or ₦50,000, or at a delivery band edge | unit | mutation_pricing_pct: the `>=` to `>` mutant in `discount_bp` survives |
| VAT rounds the wrong way on a half kobo | unit | no test in `test_money.py` uses an odd amount |
| Promo applies a day early or late (Lagos day against UTC day) | unit | 3 `promo_applies` mutants survive |
| Provider answers differently from what the client expects | contract | smoke test checks one response against `contract.json` |
| Provider is down, slow or declines: the order must not be paid or lost | integration | provider modes `500`, `timeout`, `decline` |
| Two requests with one idempotency key create two orders | integration | the race is in `place_order`: lookup, charge, save |
| A seller sees another seller's draft in search | integration | `/search?seller=` returns that seller's own drafts only |
| The suite itself lies: flaky or order-dependent tests | smoke | suite_failures_of_50 |

## Levels

| Level | What it is for | Tests | Time |
|---|---|---|---|
| unit | pricing and money rules, boundaries, the clock | 10 | 0.1 s |
| integration | `place_order`, the API, the sqlite file, search lag | 6 | 0.4 s |
| contract | provider responses against `contract.json` | 0 | none yet |
| e2e | one browser order on `GET /` | 1 (skipped without Chromium) | 0.3 s |
| smoke | both apps started, one order, replay, decline, 500 | 9 checks | 2 s |

## Not tested

- Page layout and styling of `GET /`. One browser test checks the order flow. A visual bug costs a patch, not money.
- The fake provider's internals. It is a test double. `contract.json` is the thing we trust.
- The real provider. Nothing here calls it. Its behaviour is checked in production with synthetic orders.
- Capacity beyond the lab's load test. We make no claim about peak Black Friday traffic from this suite.

## Environments and data

Every test uses a temporary sqlite file (the `db` fixture), a `FakeClock` at 2026-11-23 09:00 UTC and a stub payments client. The smoke test starts both apps on 8094 and 8095 with its own temporary database. No shared database, no production data, no real card. Catalogue ids 1 to 4 are the only seed data.

## Exit criteria

A change merges when all of these hold on the evidence taken from the branch.

gate: suite_seconds <= 120
gate: coverage_pct >= 60
gate: mutation_pricing_pct >= 40
gate: suite_failures_of_50 <= 0
gate: quarantined_tests <= 1

Coverage is a floor, not a goal. The mutation score is read by file, and survivors are reviewed in the pull request.

## Ownership

- Djibril, who inherited the suite, owns this file and the exit criteria. Gebre, who leads the checkout team, approves it.
- Aissatou owns the provider contract and the fake provider.
- The checkout team owns the quarantine list: nothing stays there more than two weeks.
- An escaped bug gets a test at the cheapest level that can catch it, and its risk row is added or corrected.

5. Check it. Create scripts/strategy_check.py. It fails if a section is missing, a risk row has no level (from a fixed list) or no evidence, fewer than three things are listed as not tested, a gate names a key that evidence.txt does not have, or a gate fails against the measured number. It also fails above 900 words.

"""Check STRATEGY.md: its shape, and its gates against evidence.txt.

    .venv/bin/python scripts/strategy_check.py
"""
import operator
import re
import sys
from pathlib import Path

LAB = Path(__file__).resolve().parent.parent
HEADINGS = ["Scope", "Risks", "Levels", "Not tested", "Environments and data", "Exit criteria", "Ownership"]
LEVELS = {"unit", "integration", "contract", "e2e", "smoke", "production"}
OPS = {"<=": operator.le, ">=": operator.ge, "<": operator.lt, ">": operator.gt, "==": operator.eq}
problems = []

def section(text, name):
    m = re.search(rf"^## {re.escape(name)}\s*$(.*?)(?=^## |\Z)", text, re.S | re.M)
    if not m:
        problems.append(f"missing section: {name}")
        return ""
    return m.group(1)

text = (LAB / "STRATEGY.md").read_text()
evidence = {}
for line in (LAB / "evidence.txt").read_text().splitlines():
    m = re.match(r"(\w+): ([\d.]+)$", line)
    if m:
        evidence[m.group(1)] = float(m.group(2))

sections = {h: section(text, h) for h in HEADINGS}
words = len(text.split())
if words > 900:
    problems.append(f"{words} words: a strategy is one page (900 words at most)")

for row in sections["Risks"].splitlines():
    cells = [c.strip() for c in row.strip().strip("|").split("|")]
    if len(cells) < 3 or cells[0] in ("Risk", "") or set(cells[0]) <= {"-", " "}:
        continue
    level = cells[1].strip("` ")
    if level not in LEVELS:
        problems.append(f"risk '{cells[0][:40]}': level '{level}' is not one of {sorted(LEVELS)}")
    if not cells[2]:
        problems.append(f"risk '{cells[0][:40]}': no evidence")

if len(re.findall(r"^- ", sections["Not tested"], re.M)) < 3:
    problems.append("Not tested: list at least three things, each with its reason")
if len(re.findall(r"\bowns\b", sections["Ownership"])) < 2:
    problems.append("Ownership: say who owns at least two things, with the word 'owns'")

gates = re.findall(r"^gate: (\w+) (<=|>=|<|>|==) ([\d.]+)", sections["Exit criteria"], re.M)
if not gates:
    problems.append("Exit criteria: write gates as 'gate: key <= number'")
for key, op, limit in gates:
    if key not in evidence:
        problems.append(f"gate {key}: no such line in evidence.txt")
    elif not OPS[op](evidence[key], float(limit)):
        problems.append(f"gate {key} {op} {limit} FAILS: evidence.txt says {evidence[key]:g}")
    else:
        print(f"ok   gate {key} {op} {limit} (measured {evidence[key]:g})")

for p in problems:
    print("FAIL", p)
print("STRATEGY OK" if not problems else f"{len(problems)} problem(s)")
sys.exit(1 if problems else 0)
.venv/bin/python scripts/strategy_check.py
ok   gate suite_seconds <= 120 (measured 2.31)
ok   gate coverage_pct >= 60 (measured 80)
ok   gate mutation_pricing_pct >= 40 (measured 41)
ok   gate suite_failures_of_50 <= 0 (measured 0)
ok   gate quarantined_tests <= 1 (measured 1)
STRATEGY OK

Every exit criterion is a claim, and each claim was re-measured by a script, not asserted. If a gate on your suite fails, that is the strategy working: either fix the suite or change the gate and say why in the pull request.

Raise the mutation gate to what a strategy might promise in a quarter: in STRATEGY.md change gate: mutation_pricing_pct >= 40 to >= 70 and run the checker again. It prints FAIL gate mutation_pricing_pct >= 70 FAILS: evidence.txt says 41 and exits with 1. The page is now making a promise the suite cannot keep, and a script says so. Now break a different part: change the level of the provider row to staging. The checker rejects it, since staging is not one of the levels the strategy defines. Put both back. The point is that the strategy is a document you can test.

6. Put the lab back. You added four files and two generated ones, and the mutation run left a cache. Remove them, point CHECKOUT_DB back to its default and confirm the lab is as shipped. If you want to keep STRATEGY.md and the scripts for the project, which builds on them, move them out of the lab first.

rm -f scripts/evidence.sh scripts/strategy_check.py STRATEGY.md evidence.txt /tmp/strategy-lab.sqlite
rm -rf mutants
unset CHECKOUT_DB
git status --short .
.venv/bin/pytest -q 2>&1 | tail -1
git status --short . prints nothing (mutants/ is git-ignored), and the suite ends 23 passed, 1 skipped, 1 deselected.
DECIDE

The director reads your strategy and likes it, then asks for one number she can put in the quarterly report. She suggests 90% line coverage across the checkout package, enforced in CI. The package is at 80%, and the money rules have a 41% mutation score. The team has three weeks before year-end sales.

READING
  1. DOC
    Heuristic Test Strategy Model James Bach, 2024

    Version 6.3 (December 2024): guide words for project elements, product factors and quality criteria, to ask what you have forgotten. Use it as a checklist beside your risk table; do not try to fill every cell.

  2. BOOK
    Testing for Reliability, Site Reliability Engineering, chapter 17 Alex Perry and Max Luebbe, 2016

    The argument that a test which blocks a release removes a bug before users meet it, and where production tests cover what pre-release tests cannot. Skip the sections on creating a test and build environment. Read: the sections on traditional tests (unit, integration, system) and on production tests (canary, configuration, stress).

  3. POST
    Testing Strategies in a Microservice Architecture Toby Clemson, 2014

    Unit, integration, component, contract and end-to-end tests defined by what each isolates. Read it for the definition of each level, which you can borrow for your levels table; the examples are Java.

  4. POST
    TestPyramid Martin Fowler, 2012

    Two minutes on why you want more low-level tests than UI tests. Read it as one input to the levels table, not as the strategy.

  5. BOOK
    Software Engineering at Google, chapter 11: Testing Overview Adam Bender, 2020

    How a large organisation describes tests by resources used and aims for a mix, with numbers. Read the test size and mix sections; they are the closest thing here to a stated strategy. Read: the sections on test size and on the test mix.

  6. BOOK
    Unit Testing Principles, Practices, and Patterns Vladimir Khorikov, 2020

    Frames tests by what they protect and what they cost to keep. Use it when deciding which tests earn a place; the C# examples can be skipped. Read: the opening chapters on the goal of unit testing and what makes a good test.

All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.

RECALL CARDS Tap to flip. They join your review deck when you mark the lesson complete.
NEXT: CI at scale: speed, sharding and test selection →