tdd-iron-law
The Iron Law
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST.
This is not a guideline. It is the floor of the discipline. The Iron Law has exactly one consequence when violated:
Delete the code. Write the test. Start over.
Not "add a test after the fact." Not "promise to add one later." Delete the production code, write the failing test you should have written, then re-derive the implementation under the Red-Green-Refactor cycle. The deletion is not punishment — it is restoration of the feedback loop that the violation disabled.
Grounding (primary sources)
The Iron Law is not a stylistic preference. Four primary sources converge on it:
Beck (2002) Preface — the canonical formulation
Kent Beck, Test-Driven Development: By Example (Addison-Wesley Signature Series), ISBN 978-0321146533, Preface:
"Write the test you wish you had. Make it fail. Make it pass. Make it clean."