Replace an over-mocked test with a contract test
A test that passes because the mocks agree with each other rather than with the real thing.
The ticket
Rewrite an over-mocked test so it asserts against the real shape of the dependency.
Acceptance criteria
- The test validates against the dependency's real schema or a recorded response
- It fails when the real shape changes
- Mocks that only restate the implementation are removed
- The test still runs without network access
What lands as proof
A demonstration that changing the real shape now breaks the test, which the mocked version did not do.
Why teams defer it
- A green suite is a bad time to argue that the tests are not really testing anything.
- Rewriting a passing test looks like zero progress on any board that counts tickets.
Questions
- What does the agent actually change?
- The ticket is scoped to one outcome: rewrite an over-mocked test so it asserts against the real shape of the dependency. 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 the test fails when the real shape changes, so a reviewer can confirm the result without reproducing the work locally.
- How much oversight does this need?
- The run stops once the plan is written. Somebody reads the approach and approves it before any code exists, which is the cheapest moment to redirect the work.