Re-express tests that assert implementation detail as behaviour tests
Tests that break whenever the code is refactored, rewritten to assert what the code does rather than how.
The ticket
Rewrite a suite that asserts internals so it asserts observable behaviour instead.
Acceptance criteria
- Assertions describe observable behaviour rather than internal calls
- Coverage of the behaviour is unchanged or better, shown in the report
- Every removed assertion is justified in the description
- The plan is approved before any test is deleted
What lands as proof
A before and after coverage comparison, plus a written justification for each assertion removed.
Why teams defer it
- Deleting assertions looks like reducing safety, so it needs a person willing to defend the change.
- The suite that most needs it is usually the one guarding the code people are most nervous about.
Questions
- What does the agent actually change?
- The ticket is scoped to one outcome: rewrite a suite that asserts internals so it asserts observable behaviour instead. Work that serves that outcome is in scope, and anything outside it is left for a separate ticket, so the pull request stays reviewable.
- How do I know the work is done?
- The pull request carries the evidence, not only the diff. Here that means removing assertions is reviewed on the plan before any edit, so a reviewer can confirm the result without reproducing the work locally.
- How much oversight does this need?
- The run stops for the plan, and the review bar is raised afterwards so that smaller suggestions block the merge too, not only serious findings.