Hacker News · AI·· 1 h agoAI score58
Tests as data: a method for keeping AI-generated code verifiable
Tests as data: Ensuring AI-generated code does what we want
AI summary
Martin Fowler proposes writing tests as data rather than code so that AI-generated production code stays verifiable when coding agents also refactor the tests. The approach combines customer tests, black-box testing, tabular or YAML test cases, and an AI-generated test runner, with the test data kept in text files that are easier to review and protect from unexpected edits. The article draws on interviews with 26 Thoughtworks developers in early 2026 who said they no longer fully trust their tests once AI refactors them, and it pairs the method with mutation testing, property-based tests, and human exploratory testing.
Source:Hacker News · AI · martinfowler.com