SuperAPI AI Directory

tdd

Testing & quality

View repository

Updated 10-16 06:16

About this skill

TDD

Tests verify behavior through public interfaces, not implementation. Good tests survive refactors; bad tests break on rename.

See tests.md and mocking.md for examples.

Anti-pattern: horizontal slices

Don't write all tests then all code. One behavior: RED → GREEN → repeat.

Workflow

  1. Plan — read CONTEXT.md/ADRs. Confirm interface changes and behaviors to test with user.
  2. Tracer bullet — one test, one minimal implementation, passes.
  3. Loop — one test at a time; only code to pass current test; no speculation.
  4. Refactor — only when GREEN; see refactoring.md.

Per-cycle checklist

  • Describes behavior, not implementation
  • Uses public interface only
  • Minimal code for this test