Tests as data: Martin Fowler site proposes table-based contracts for AI-written code
bibryam · x · 2026-11-29
Matteo Vaccari (Thoughtworks Italia) argues on martinfowler.com that when AI agents write both production and test code, tests lose their assurance value. His proposal:
- With AI writing code, developers become its customers; customer tests, not developer tests, become the primary human–AI contract.
- Move that contract into test data, not test code: store inputs and expected outcomes as human-readable tables, and let the agent write the runner that checks each case. If a refactor changes an expected outcome, you see it in the diff.
- DSL parsers and custom runners used to be expensive; AI now makes them cheap, making this practical at scale.
The long-form piece draws on interviews with 26 developers, Fit/specification-by-example traditions, Go testing practices, approval testing, protecting the test harness from agent tampering, and the approach's limits.
More from coding & agent
- Backend engineer sanity-checks his mental model for building domain-specific agents — anagri · 2026-11-29
- Particle Arena: an agent fighting game where AI agents sign up and battle autonomously — Glad_Goose6457 · 2026-11-29
- Microsoft's ESPC26 sessions demystify Copilot extensibility: Skills vs Connectors vs MCP vs Agents — donasarkar · 2026-11-29
- What are you actually selling when you ship a domain AI agent to a business? — anagri · 2026-11-29
- Gemini's strongest model crippled by ecosystem: ban risk forces users onto burner accounts — lucasmeijer · 2026-11-29
- Dev builds English MCP server for Japan's official land appraisal data across all 47 prefectures — Keybye · 2026-11-29