# 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.

Category: Test coverage and flaky tests
Source: https://letsship.ai/use-cases/re-express-implementation-tests
Published: 2026-08-25

## Goal

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.

## Prompt

Copy this to an agent to open the ticket:

```text
Create a Linear issue in my team and assign it to the SHIP agent.

Title: Rewrite {suite} to assert behaviour

Description: 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

Before you create the issue, find a suite in this repository that asserts on internal calls or private state and replace {suite} with it.
```

## 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.
