Glossary

TDD

Acronym
Also known as: test-driven-development, test-first
TechTestingMethodology

Definition

Test-driven development — writing the test before the code it tests, watching it fail, writing the least code that makes it pass, then cleaning up with the test as a safety net; the red–green–refactor loop, repeated in small steps

Kent Beck's practice, and this repository's rule. The test written first is a statement of what the code should do, made before the author knows how — which is why it catches a design that is hard to use before it is built. The failing run matters as much as the passing one: a test that never went red may not be testing anything. TDD says nothing about the test's size; unit is the usual grain, but a whole feature can be driven from an integration test.

Tech

Not a testing technique — a design technique that leaves tests behind. The question it forces is "how will I know this works?", asked before "how will I build it?", and code written to answer the first is easier to change.

Related Terms

  • a: Appearance
  • ?: Keyboard shortcuts