Assertion-discipline guidance: three ways a green test proves nothing #461
Labels
No labels
agent-ready
bug
contract
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-human
needs-input
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/iw-cli#461
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
From MEDECA-378 triage - three separate discoveries in one issue, all the same shape: a test that passed and could not have failed. Proposing they join the existing 'prove RED' guidance as named cases.
A suffix mutation cannot falsify a 'contains' assertion.
Proving a column-headers test could fail, the message key was mutated 'zakazky.overview.column.fazovaLhuta' -> '...fazovaLhutaMUTANT'. The suite stayed green at 74/74: the mutated string still contains the original as a substring, so html.contains(original) remained true. Re-mutating to 'zakazky.overview.column.MUTANT' turned exactly one test red. Rule: when the assertion is a substring check, only a mutation that is not a superstring of the pinned value proves anything.
A fixture that writes the read model directly proves the renderer, not the path.
A scenario ('waiting on an external authority does not raise risk') passed in E2E and by hand in the browser, while the state it asserted on was, at that time, unreachable through the application's own commands - the fixture seeded the read model instead of issuing commands. Nothing in the run distinguished 'the feature works' from 'only the fixture works'. Rule: when a fixture seeds by writing a repository, say so in the feature file, so a green run is not read as evidence the path exists.
A filter can be unfalsifiable by construction, whatever the assertion says.
A 'mine only' toggle was tested by a user whose role was absent from fullAccessRoles. Per-record authorization grants such a user exactly the records that the toggle's own definition calls 'mine' - so the visible set is a subset of 'mine' and the toggle can never remove a row. The scenario was vacuous no matter how it was written. Two conditions had to hold to fix it: the 'someone else's' row had to be an entity type the user really can see with the toggle off, and the scenario had to assert the count BOTH before and after the toggle. A single post-toggle count cannot distinguish 'the filter removed it' from 'it was never there'.
The general form of (3) is worth stating on its own: before writing a filter scenario, check whether the authorization already implies the filter's predicate for the chosen user. If it does, no assertion can save the scenario.
Type: feature
Filed from:
/home/mph/Devel/projects/medeca-modul-poptavky-MEDECA-378on branchMEDECA-378Intake: needs-input
1. Where must the three assertion-discipline cases go: dev-docs, iw-cli, or both?
The issue says to add three named cases to "the existing 'prove RED' guidance". That guidance is in the dev-docs repository, in the shared implementation-workflow snippet blueprints/snippets/assertion_discipline.md. iw-cli has no "prove RED" text. Its docs/testing.md has only an iw-cli section, "Asserting a rejection". The examples come from MEDECA (feature files, read-model fixtures, role-based authorization), and iw-cli has none of these.
docs/testing.md. Only iw-cli readers see them, and cases 2 and 3 have no iw-cli example.docs/testing.md.Recommended: a): the guidance the issue names is in dev-docs, and the examples are not about iw-cli.
Answer in a comment on this issue, per number, for example "1: a", or in your own words; intake reads it on its next iteration.