Notes
Start from risk
Start from what would hurt the business, not from tools. For ShopRung: money, wrong discounts, shipping or rounding. Access, one customer seeing another's order. Stock, selling what is not there. Account rules. Search, because customers who cannot find products do not buy. The AI support chat, which can be wrong, leak or be injected, and costs money per answer. And speed. Each risk needs at least one test that would catch it.
- money: wrong discounts, wrong shipping, rounding
- access: another customer's order
- stock: overselling
- accounts: sign-up and login rules
- search: customers cannot find products
- AI chat: wrong, leaked or injected answers; cost
- speed: slow search and chat
Pick the level
For each risk, pick the cheapest level that can see it. Pricing rules at unit level. Business rules and access through the API: ShopRung has twenty three pytest tests. User journeys in the UI: seven Playwright tests, plus accessibility and visual checks. The AI chat with evals, agent tests and a red team suite. Speed with k6 and JMeter. And people, in exploratory sessions, for what nobody thought to automate.
- unit: pricing rules (lab 6)
- API: 23 pytest tests (lab 11)
- UI: 7 Playwright tests (lab 13), accessibility, visual
- AI: evals 12 questions, agent 10 tests, red team 8 attacks
- performance: k6 and JMeter
- humans: exploratory sessions (lab 2), each release
Where it runs
Then decide where each runs. On every pull request, the fast deterministic suites: the API suite took two seconds, the UI suite four, and the three AI suites on the fake model under a second; about seven seconds in all. Nightly, what is slow or noisy: the k6 load test, evals and red team rates on a real model. Before each release, an exploratory session and accessibility checks.
every pull request: API 2.0 s, UI 4.0 s, AI suites on the fake model 0.8 s: about 7 s in all nightly: k6 load test, evals on a real model, red team rates each release: exploratory session, accessibility
Test the strategy
Now test the strategy itself. ShopRung has seventeen planted bugs. We switched each one on, alone, reset the data, and ran five suites: API, UI, agent, red team and evals, recording whether any test failed. For slow search we used the k6 and JMeter results from their labs. This is the strongest evidence a strategy can have: known bugs, and whether anything noticed.
- ShopRung has 17 bugs you can switch on, one at a time
- for each: reset, switch on, run API, UI, agent, red team and eval suites
- a bug is caught if any test in a suite fails
- k6 and JMeter results from their labs
Measured
The result. The API suite caught seven bugs, the UI suite three, including case sensitive search, which the API suite missed because it has no search tests at all. The evals and the red team suite caught three chat bugs each, the agent tests one, and the load tests caught slow search. Fourteen of seventeen bugs were caught by at least one suite. Three were caught by nothing.
API (23 tests) 7 bugs UI (7 tests) 3 bugs incl. search-case: API missed evals 3 chat bugs red team 3 chat bugs agent 1 chat bug k6, JMeter slow-search caught by any: 14 of 17 caught by none: 3
The gaps
The three misses are worth reading. Discount rounding: SAVE ten on fifty four ninety seven gives five forty nine instead of five fifty, because no test uses a subtotal with half a cent. Name length: a fifty one character name is accepted, because no test signs up with a long name. And the slow chat adds three seconds per answer, still inside the ten second requirement, so only a latency budget would notice. Each gap is now a decision.
discount-rounding: SAVE10 on $54.97 gives $5.49, not $5.50 (PRICE-6) name-length: a 51-character name is accepted (ACC-2) chat-slow: +3 s per answer, still inside AI-7's 10 s; only a latency budget sees it
Decide
A strategy decides what to do about each gap, based on risk. Rounding loses money on real orders, so it gets an API test at fifty four ninety seven. The name rule is low impact, but the test costs a minute, so add it. The slow chat is within its requirement, so it gets a latency budget in the nightly run rather than a failing test. Write each decision down with its reason: that record is part of the strategy.
- discount-rounding: money on real orders → add an API test at $54.97
- name-length: low impact → add a cheap boundary test
- chat-slow: within the rule → a nightly latency budget
- write the decision down, with its reason
The document
Keep the document to one page people will read. The product and its top risks. Which level covers what. Where and when each suite runs. Environments and test data. Entry and exit criteria for a release. The evidence: the bug matrix, escaped bugs and flakiness. Known gaps with their decisions. And owners, with a review every quarter, because the product and its risks change.
- 1 product and its top risks
- 2 test levels: what each covers
- 3 where and when each runs
- 4 environments and test data
- 5 entry and exit criteria
- 6 evidence: the bug matrix, escapes, flakiness
- 7 known gaps and decisions
- 8 owners; review every quarter
Common mistakes
Mistakes. A strategy that is a list of tools instead of risks. Testing everything through the UI, which is slow and fragile. Slow or noisy suites on every pull request, so people stop waiting for them. Never testing the strategy with known bugs. Using code coverage as the evidence. Leaving gaps undecided. And a thirty page document nobody reads.
- a list of tools, not risks
- everything at the UI level
- slow suites on every PR
- never testing the strategy
- coverage % as the evidence
- gaps nobody decided about
- a 30-page document nobody reads
Say it like this
In the interview: I start from product risks. For each, the cheapest test level that can catch it, and where it runs: fast deterministic suites on every pull request, slow and noisy ones nightly, people before releases. Then I test the strategy with planted bugs. On our shop, fourteen of seventeen were caught; the three gaps became decisions, made by risk. One page, with owners, reviewed every quarter.
- "From product risks: for each, the cheapest level that can see
- it, and where it runs: fast
- suites on PRs, slow ones
- nightly. Then I test the strategy with planted bugs. On our shop, 14 of 17 were caught;
- the 3 gaps became decisions, by risk. One page, reviewed
- quarterly."