Glossary

TDD (Test-Driven Development)

TDD is a development methodology: write a failing test first, then the minimum code to make it pass, then refactor. The "red → green → refactor" cycle repeats for each small piece of functionality.

The Red-Green-Refactor cycle

  1. Red — write a test for new behaviour. It fails because the code does not exist yet
  2. Green — write the minimum code to make the test pass. Any way works
  3. Refactor — improve the code without changing behaviour. The test stays green

Benefits

Criticism

Slows initial development. Hard to apply to UI, legacy code, and integrations. Most teams use TDD selectively, not universally.