Notes
Trap 1
Trap one: precise looking output. With a worked example in the prompt, the model gave exact amounts, and wrong ones: two dollars fifty off at fifty dollars, and a discount at forty nine ninety nine, where the coupon must be refused. Exact formatting makes errors harder to see. The fix: you choose the boundaries and compute every expected value from the requirement, with code for money.
few-shot test cases: SAVE10 at $50.00 → "$2.50" (it is $5.00) $49.99 → discounted (it is refused) fix: you choose boundaries and compute every expected value from the requirement
Trap 2
Trap two: green means tested. None of six AI written test files ran as written, and the four tests that passed after fixing caught none of ten planted bugs, because they never touched the boundary. Two hand written boundary tests caught the quantity bug at once. The fix: see every new test fail once on purpose, and grade suites with planted bugs or mutation testing.
0 of 6 files ran as written best one, fixed: 4 passed against 10 planted bugs: 0 caught 2 boundary tests by hand: caught quantity-limit fix: see every new test fail once; grade with mutants
Trap 3
Trap three: checkers you never measured. Keyword checks passed two misleading answers in the golden set, and scored nine of nine before and after a real prompt regression. A naive LLM judge agreed with humans barely beyond chance, kappa zero point two eight; calibrated, zero point five two. The fix: measure every checker, keyword or judge, against human labels, and know what it misses.
keyword checks: two misleading answers passed (golden set) prompt regression, real model: keywords 9/9 before and after naive LLM judge: kappa 0.28 calibrated judge: kappa 0.52 fix: measure every checker against human labels
Trap 4
Trap four: fixes that make the build green by changing what is expected. Updating a snapshot while the free shipping bug was on made the bug the baseline in a one line diff. Playwright's healer agent is instructed it may fix assertions and expected values to make a test pass. The fix: heal locators only, and put every change to an expected value through review with the requirement beside it.
snapshot update during the free-shipping bug: green, one-line diff healer instructions: "fixing assertions and expected values ... to pass the test" fix: heal locators only, review every change to an expectation
Trap 5
Trap five: labels that send bugs away. AI triage got eight of twelve failure logs right with either prompt, never said unsure, and called a real performance bug an environment problem, the label that gets retried and forgotten. It also blamed the product for a broken test. The fix: deterministic rules first, AI as a suggestion with its reason, and a person deciding before anything is muted or filed.
8 of 12 logs labelled right, naive or guided prompt slow-search bug → ENVIRONMENT wrong test → PRODUCT_BUG never answered UNSURE fix: rules first, AI suggests, a person decides
Trap 6
Trap six: secrets travel with the context. A password showed up in an MCP page snapshot, and a trace held the password and a login token. Our own masking script missed the password the first time. Everything an agent reads can end up with a provider and in logs. The fix: secret files for browser tools, test accounts only, local models for sensitive material, and a masking script with its own tests.
MCP snapshot: textbox "Password": Alice123! trace.zip: Fill "Alice123!", Authorization: Bearer eyJ... a masking script missed the password at first fix: --secrets, test accounts, local models, tested masking
Trap 7
Trap seven: judging from one run. The same prompt made different mistakes on each of three runs, and once refused entirely. The same injection succeeded nine, two or ten times out of ten depending on the question. Malformed tool calls happened one run in three. One run tells you almost nothing about a model. The fix: repeat, report rates with their sample sizes, and be modest about small samples.
same test-case prompt, 3 runs: different mistakes each time one run refused the task injection with defences off: 9/10, 2/10, 10/10 by question malformed tool calls: 1 in 3 fix: repeat, report rates and sample sizes
The fix
The fix behind all seven is the same habit you apply to any system under test. Build a labelled sample of right answers. Measure the tool on it: agreement, bugs caught, rates over repeated runs. Put deterministic checks around it. Gate its output with review. Give every change a human owner. And measure again whenever the model, prompt or tool changes. AI in testing is a system to test.
- 1 a labelled sample: what is the right answer?
- 2 measure: agreement, caught bugs, rates over runs
- 3 checks around it: rules, allowlists, planted bugs
- 4 review gates on its output
- 5 a named human owner
- 6 measure again after changes
Say it like this
In the interview: false confidence. AI output looks right, so people stop checking. I have seen exact but wrong expected values, green AI tests that caught none of ten planted bugs, judges and triage nobody measured, a healed snapshot that accepted a bug, and secrets in an agent's context. So I measure each AI tool on labelled cases, put checks and review gates around its output, and keep a human owner for every change.
- "False confidence. AI output
- looks right: exact but wrong
- expected values, green tests
- that caught none of ten bugs, judges and triage we never
- measured, healed tests that accepted a bug, and secrets in context. I measure each tool on labelled cases, gate its output
- and keep a human owner."
Common mistakes
Here are the traps as questions to ask in any review. Who computed this expected value? Has this test ever failed? Was this checker measured against people? What exactly did the heal change? Who confirmed this triage label? What data did we send, and where? And how many runs is this result based on? If nobody can answer, the AI output is not ready to be trusted.
- who computed this value?
- has this test ever failed?
- was this checker measured?
- what did the heal change?
- who confirmed this label?
- what did we send, and where?
- how many runs is this from?