/looptestingmedium riskintermediatesafety D · 50 · open-endedForward Futurepre-dates current gate · under review

Make the test suite fast

Cut test runtime under repeatable conditions without weakening coverage, assertions, isolation, or behavior.

prompt
→ Claude
Optimize the test suite to run as quickly as possible without reducing coverage or changing behavior.
claude-code · codex

Use this when

Use this when slow tests are delaying local feedback or continuous integration and the project has stable commands for measuring runtime and coverage.

How it runs

  1. Record the full-suite runtime, coverage, environment, worker settings, and repeatable timing method.
  2. Profile the suite to find expensive setup, redundant work, poor isolation, unnecessary integration paths, or safe parallelization opportunities.
  3. Make one optimization at a time, then rerun the full suite and compare timing, coverage, and behavior.
  4. Stop at the agreed runtime target or diminishing-returns rule with all original checks still passing.

Done when

The suite is faster with no coverage or behavior regression. Repeatable timing, the full passing suite, and the original coverage report prove the result.

Why it works

A fixed baseline prevents speed work from quietly trading away coverage or correctness. Profiling directs effort toward measured bottlenecks instead of speculative rewrites.

Implementation note

Define a runtime target or diminishing-returns rule before starting. Faster tests are not an improvement if they become flaky, order-dependent, or less representative.

Source: Forward Future

More testing loops

Watch tests while you work

/loopnew

A passive watchdog loop that reruns your test suite every 15 minutes and surfaces failing tests with their error output.

prompt
→ Claude
/loop 15m run the test suite, and if anything fails, show me the failing tests and the error output
testinglow risk

Kill flaky tests

/loopnew

Run your test suite repeatedly, collect every intermittent failure, and fix or quarantine flaky tests until you get five consecutive green runs.

prompt
→ Claude
/loop run my test suite 20 times, collect every intermittent failure, fix or quarantine the flaky ones, and don't stop until you get 5 consecutive fully-green runs
testinghigh risk

Make all tests pass

/goalnew

Implement remaining code and run tests repeatedly until the full suite passes.

prompt
→ Claude
/goal finish the implementation and make all tests pass
testingmedium risk