Mark Seemann draws a metaphor between TDD and mathematical induction to explain why test-driven code tends to work across multiple environments in a non-linear fashion. Starting with an anecdote about locale-dependent test failures discovered when a UK developer joined a Danish team, he explores how tests make implicit assumptions about their execution context. He argues that once a test passes in one environment and then a second, it tends to pass in most subsequent environments — analogous to how mathematical induction works with base cases. The post emphasizes that tests must explicitly state all relevant assumptions, warns against Ambient Context as an anti-pattern, and notes that Haskell's deterministic APIs help avoid such implicit environment dependencies.
Table of contents
Horizontal scaling #Two as many #TDD and inductive reasoning #Tests as statements #Tests are the first clients #Mathematical induction #Implicit assumptions #Conclusion #Sort: