FOR QA AND ENGINEERING
“All green.” And the customer still calls.
A hundred tests pass, and then two discount codes stack after all. FACET shows you, per feature, which cases a test really checks — and which important case has no test at all.
| A valid code lowers the total oncevalid-code-lowers-total | named ×2 |
|---|---|
| An expired code is refusedexpired-code-rejected | named ×1 |
| Two codes don't stackcodes-do-not-stack | no test |
| The discount is capped at 50 %discount-capped | named ×3 |
Illustrative example · scenarios and the evidence the record names
WHAT COVERAGE DOESN'T SAY
85% coverage. And nobody knows if the discount rule is tested.
A line can run ten times without any test checking what it is there for. FACET asks a different question: which cases does this feature have to handle — and which of them really has a test?
contract: scenarios: - id: valid-code-lowers-total - id: expired-code-rejected - id: codes-do-not-stack - id: discount-capped
// @facet: checkout/pricing/discount-codes// @facet-proves: valid-code-lowers-totalit("applies a valid code once", …)// @facet: checkout/pricing/discount-codes// @facet-proves: expired-code-rejectedit("refuses an expired code", …)// codes-do-not-stack: —
THE NEXT TEST QUESTION
Instead of “we should test more”: the one test that is actually missing.
Your coding agent reads the feature, spots the case without a test and proposes exactly that one. No coverage sprint, no testing week — one missing case per feature.
Which scenario of checkout/pricing/discount-codes has no test yet?
codes-do-not-stackGiven two valid codes, When both are applied, Then only the higher one counts. No test names this scenario. Proposal: one case in discount.spec.ts.
WHAT FACET DOES NOT DO HERE
An open question is not yet a bug.
A missing test link is an open question, not a proven bug.