tdd

Installation
SKILL.md

TDD

Write the failing test first, then the minimal code to pass it, then refactor. One test at a time. Test behavior, not implementation.

Tradeoff: TDD biases toward design clarity and coverage over raw speed. For trivial or throwaway code, use judgment.

1. Write the failing test first

Before any implementation code exists, write one test that describes the behavior you want. Run it; it must fail. A passing test before the code exists is testing nothing.

2. Red, Green, Refactor

  • Red: write one failing test for the simplest unhandled case.
  • Green: write the minimal code that makes it pass.
  • Refactor: improve the code without changing behavior; tests stay green.

Then repeat for the next case. The order is the discipline.

3. One test at a time

Installs
1
First Seen
Jul 29, 2026
tdd — hermeticormus/tdd-skills