When expected results share the implementation's misreading, passing tests can agree with that misreading.
I used a fictional workshop, W-01, to compare three expectations aligned with an old rule against four cases derived from a separate specification. The example shows where expectations come from and why a permitted case matters when checking a fix.
Put the condition outside the implementation
The fictional requirement is short:
At least two registered members are required. Guests may accompany them, but guests do not count toward the minimum.
Inputs are restricted to nonnegative integer counts. Input formats, negative values, and other validation are outside this example.
The old implementation counts both groups:
const oldRule = (members, guests) => members + guests >= 2; For the illustration, consider these three old expectations aligned with that rule. They are newly constructed examples, not exported private tests.
| Members | Guests | Old expected result |
|---|---|---|
| 0 | 0 | false |
| 2 | 0 | true |
| 1 | 1 | true |
The old implementation passes all three. The last expectation, however, contradicts the requirement that guests do not count toward the minimum. Hardcoded true and false values are not independent evidence when they preserve the same misreading.
Derive each result from the requirement
Without treating the implementation as the answer, the fictional specification gives these results:
| Members | Guests | Expected result | Basis |
|---|---|---|---|
| 0 | 0 | false | Fewer than two registered members |
| 2 | 0 | true | Exactly two registered members |
| 1 | 1 | false | A guest cannot fill the member shortfall |
| 2 | 1 | true | Guests are allowed once the member condition is met |
Against these same four cases, the old implementation passes three. It returns true for one member and one guest, where the requirement gives false.
The corrected rule counts registered members:
const correctedRule = (members, guests) => members >= 2; It matches all four expected results. Those results are fixed separately with their reasons; they are not generated by calling the corrected function.
Keep the permitted case that catches an overcorrection
Two members with one guest is a necessary case.
A stricter fix could require at least two members and zero guests. That removes the shortfall problem while also rejecting an accompanying guest the specification permits. Running that variant against the same four cases catches the rejection in the last row.
| Rule | Matches against the same specification cases |
|---|---|
| Members plus guests is at least two | 3/4; incorrectly accepts one member and one guest |
| Members is at least two | 4/4 |
| Members is at least two and guests is zero | 3/4; incorrectly rejects two members and one guest |
A useful fix check preserves what the requirement allows as well as rejecting what it forbids. Making a rule more restrictive does not, by itself, make it correct.
A separate AI or file is not a separate basis
Different implementation and test writers can still receive the same mistaken description. This example concerns the source of the expected result, rather than adding another refuter role.
Put the relevant requirement beside each expected value. When the requirement is ambiguous, keep that ambiguity visible instead of filling it with an expectation convenient for the code.
The fresh execution here used V8 through Node.js and only this fictional example: the three illustrative old expectations, four specification-derived cases, corrected rule, and overcorrection. No real service, application requirement, or private code was used. It does not establish correctness for every input, input validation, or applicability to a real system. It is not a reconstruction of a private application or a production bug report.
Passing tests establishes agreement with the supplied expectations. The specification that justifies those expectations remains a separate question.
Related
- Three independent proposals won't find the error. Adding a refuter killed one of them.
- "Zero matches" and "couldn't read the file" look identical
I write about the evidence behind results that look successful in AI-assisted development.
AI assisted the fictional example's design, code, validation, and the organization and writing of this article. Agreement between AI outputs is not presented as proof of independent specification review.

