test-driven-development · Test-Driven Development

test-driven-development

Implementing a feature or fixing a bug starts with a test: watch it fail, write the minimal code to pass, then refactor.

The iron law: no production code without a failing test first — code written before the test gets deleted and rewritten. Red (write a failing test) → verify red (correct failure reason) → green (minimal implementation) → verify green (full suite passes) → refactor. Exceptions (throwaway prototypes, generated code, config files) need the human partner's approval first.

Example invocation: "Implement this retry logic with TDD."

Full brief

Positioning

test-driven-development is a strict development discipline: write the test first, watch it fail, then write minimal code to pass. It governs the order of writing code — not a testing tutorial.

Core capabilities

Workflow

  1. Write one minimal test describing the expected behavior
  2. Run it; confirm it fails (fails, not errors; failure reason as expected)
  3. Write minimal code to make it pass
  4. Run the current test + the full project suite; confirm all green, output clean
  5. Refactor (dedupe, rename, extract), staying green
  6. Next test; repeat the loop

Inputs & outputs

Input Required Notes
Feature requirement / bug Yes The feature to build or the bug to fix

Output: test-first code + an all-green test suite.

Fit

Before you start


test-driven-development is part of the Aiglade Skill library. Invoke it from the Aiglade chat box in plain language.

← All 155 skills