Test-Driven Development (TDD)
A development workflow where a failing test is written before the implementation code, following a strict red-green-refactor cycle.
Test-Driven Development is a workflow — not just a testing technique — where you write a failing test *before* writing the implementation code that makes it pass, following a disciplined, repeating three-step cycle often summarized as 'red, green, refactor.' It's as much a design practice as a correctness-verification practice, and interviewers ask about it to gauge whether you understand the workflow's actual purpose beyond just 'writing tests early.'
TDD is like a sculptor who first describes precisely, in words, exactly what the finished statue's specific pose and expression should look like (the failing test) before touching the marble, then carves only enough to match that exact description (minimal implementation), and only afterward smooths and polishes the surface (refactor) — confident that the carved shape's core measurements already match the original written description, checked and rechecked, throughout the smoothing process.