# Backfill unit tests for one uncovered module

A module that works and has no tests, brought up to a stated coverage threshold.

Category: Test coverage and flaky tests
Source: https://letsship.ai/use-cases/backfill-unit-tests-for-one-module
Published: 2026-08-25

## Goal

Write unit tests for one uncovered module until it reaches the agreed coverage threshold.

## Acceptance criteria

- The module reaches the stated line and branch threshold
- Tests assert behaviour, not the shape of the implementation
- Edge cases the module already handles are covered, including the error paths
- No production code changes except to make something testable, and each such change is called out

## What lands as proof

The coverage report before and after, and tests that fail if the module's behaviour is changed.

## 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: Cover {module} to {threshold}% in tests

Description: Write unit tests for one uncovered module until it reaches the agreed coverage threshold.

Acceptance criteria:
- The module reaches the stated line and branch threshold
- Tests assert behaviour, not the shape of the implementation
- Edge cases the module already handles are covered, including the error paths
- No production code changes except to make something testable, and each such change is called out

Before you create the issue, run coverage on this repository, pick a module well under the threshold that carries real logic, and replace {module} and {threshold}.
```

## Questions

### What does the agent actually change?

The ticket is scoped to one outcome: write unit tests for one uncovered module until it reaches the agreed coverage threshold. 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 coverage report before and after, in the pull request, so a reviewer can confirm the result without reproducing the work locally.

### How much oversight does this need?

None is required before the run starts. Every claim this ticket makes can be checked by machine, so the agent works straight through and a person reviews the finished pull request like any other.
