Notes
Score the risks
Score each area on two scales. Likelihood: is the code complex, does it change often, has it broken before, is it new technology like the AI chat? Impact: does a failure lose money, leak data, break a law, affect many users, or leave no workaround? Multiply them. Do it with developers and the product owner, because each sees different risks. The numbers are judgement, written down so they can be argued with.
- likelihood 1-3: complex code, frequent change, past bugs, new tech (the AI chat)
- impact 1-3: money, data, legal, many users, no workaround
- risk = likelihood x impact
- score with dev and product, not alone
The register
Here is a register for ShopRung. Prices and coupons score highest: many rules, frequent changes, and every mistake costs money. Orders and access are less likely to break but a leak is serious. The AI chat is new and changes often. Accounts rarely change, but a broken sign-up stops every new customer. These are the team's estimates, not measurements, and that is fine: their job is to set priorities.
area L I risk prices, coupons 3 3 9 orders, access 2 3 6 AI chat 3 2 6 cart and stock 2 2 4 accounts 1 3 3 search 2 2 4 speed 2 2 4
Compare with coverage
Now compare with what the suites really do, using the bug matrix from the last episode. Prices: five API tests, three of four planted bugs caught. Orders and cart: everything caught. Search: no API tests, but the UI and load tests caught both bugs. The AI chat: five of six. And accounts: six API tests, the most of any area, and zero of one bug caught.
area API UI bugs caught
prices 5 2 3 of 4
orders 5 1 2 of 2
cart,stock 5 1 2 of 2
accounts 6 1 0 of 1
search 0 2 2 of 2*
AI chat evals, red team,
agent: 5 of 6
*slow-search via k6 The mismatch
Why? All six account tests are about logging in and tokens. Sign up, requirements one to five, has no test at all, so a fifty one character name is accepted unnoticed. The number of tests in an area says nothing about which risks they cover. Map tests to requirements, not to areas, and the hole is obvious: risk score three, coverage zero.
login returns a token bad login: same message (2) email not case-sensitive cart needs a token tampered token refused sign-up (ACC-1 to ACC-5): not one test name-length bug: not caught
Fix the top gaps
Fix the gaps in risk order. Rounding is in the highest risk area: SAVE ten on fifty four ninety seven, a subtotal with half a cent in the discount. On the normal shop the discount is five fifty; with the rounding bug, five forty nine, so the new test fails as it should. Then the cheap one: sign up with a fifty one character name. Normally refused with a clear message; with the bug, accepted with two oh one.
PRICE-6: SAVE10 on $54.97 (2 x $24.99 + $4.99) normal: discount $5.50 discount-rounding: $5.49 → fail ACC-2: sign up, 51-char name normal: 400 "Name must be 1 to 50 characters" name-length: 201 → fail
Select by risk
Risk also decides what runs first. For a pull request that changes pricing, run the pricing tests first: five tests in half a second, the fastest useful signal. Then the full suite. On ShopRung the difference is small, but on a product with hours of tests, selecting and ordering by risk is how teams get fast feedback without skipping what matters.
pytest -k "save10 or flat5 or coupons or shipping" 5 passed, 18 deselected in 0.50 s then the full API suite: 23 passed in 1.74 s at scale: minutes vs hours, so order and select by risk
Depth by risk
Risk decides depth, too. The highest risk areas get every technique: boundaries, pairwise combinations, exploratory sessions and code review, at several layers. Medium risk gets API coverage, the main journeys and security tests. Low risk gets the happy path and its most important boundary. And the register is reviewed every release and after every incident, because risks move.
- risk 9: boundaries, pairwise, exploratory, reviews, every layer
- risk 6: API and key journeys, security tests
- risk 3-4: happy path plus one boundary
- review the register each release, and after incidents
Common mistakes
Mistakes. Counting tests per area as if that measured coverage. Scoring risks alone, without developers and product. Writing the register once and never updating it. Testing everything to the same depth. Treating low risk as untested, when it still deserves a happy path. And no traceable link from each risk to its requirements and to the tests that cover them.
- counting tests per area
- scoring risk alone
- a register written once and never updated
- equal depth everywhere
- "low risk" meaning "untested"
- no link from risk to requirement to test
Say it like this
In the interview: by risk, likelihood times impact, scored with developers and product. Then I map tests to requirements rather than counting them by area: on our shop, the account area had six tests and none on sign up, so a name bug slipped through. I fix gaps in risk order, prove each new test fails on its bug, run risky tests first, and review the register every release.
- "By risk: likelihood times
- impact, scored with dev and product. Then I map tests to requirements, not areas: on our shop, the account area had six
- tests and none on sign-up, so a name bug slipped. I fix gaps in risk order, run risky tests
- first, and review the register
- every release."