Möchtest du dein Wissen auch so organisieren?

Kostenlos starten

Wiki-Seite

Test-Driven Development

Exploratory evidence suggests agent-run TDD offers no reliable quality advantage and may constrain design compared with direct implementation.

1 Quelle✦ KI-generiert von Pith

Core idea

Test-driven development (TDD) is a software-development approach in which tests are written before implementation, with the implementation then developed against those tests. In AI-assisted coding, this can mean a human writes tests first, a human reviews agent-generated failing tests before implementation, or the agent independently writes tests and then implements the solution.1

TDD inside an AI agent loop

Martin Fowler’s exploratory evaluation examined the third pattern: an agent writing tests before its own implementation.1 The evaluation used Claude/Sonnet to generate solutions and Opus to judge them, comparing TDD-style and non-TDD runs on several greenfield business-logic tasks, with each run targeting at least 80% test coverage.1

The evaluation found no clear quality advantage for TDD in the agent loop; Opus often ranked non-TDD solutions slightly higher for design and test quality, while mutation scores were similar.1 Fowler suggests that non-TDD runs may have benefited from considering architecture, data types, and edge cases as a whole before implementation, whereas incremental test-first decisions could cause an agent to settle on a design too early and leave behavior unimplemented.1

Interpretation and limits

These results are exploratory rather than conclusive: the reported comparison involved a small set of tasks and a particular model-based evaluation setup.1 They do not establish that TDD is generally ineffective, nor do they address all ways humans and agents can collaborate around tests.1 The practical implication is narrower: requiring a coding agent to simulate the full human TDD cycle should not be assumed to improve design or testing quality; outcomes should be evaluated for the task and workflow at hand.1

Evidence from AI coding agents

Martin Fowler’s exploratory comparison used five batches of greenfield business-logic tasks, with TDD and non-TDD agent runs targeting at least 80% code coverage.

Key figures
Evaluation setup
Retrieved 25 Sept 2026
Evaluation setup
LabelValueSourceEvidence
Comparison batches5martinfowler.comI created 5 batches of solutions, with two non-TDD and two TDD solutions each.
Code coverage target80%martinfowler.com_Instructions:_ In all runs, I included instructions to achieve at least 80% code coverage.

The updated article reports no clear quality or mutation-testing advantage for agent-performed TDD; non-TDD solutions were often judged slightly higher, with upfront design offered as a possible explanation.

Quellen

  1. 1

    TDD inside the agent loop - theater or actual value?

    martinfowler.com

Möchtest du dein Wissen auch so organisieren?

Speichere, was du liest — Pith schreibt dir jeden Morgen einen Report mit Belegen und baut daraus dein Wiki. Speichern ist kostenlos, KI kostet Cent pro Aktion.