<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-use-test-driven-development-with-ai-agents-without-lowering-code-quality--i9s05ckia" -->

---
title: How to Use Test-Driven Development with AI Agents...
description: Two consultants, Marco Emmer and Ferdy Arbor, built a workflow called 'exact' that combines example mapping and test-driven development to keep AI-generated...
canonical: https://daily.dev/posts/how-to-use-test-driven-development-with-ai-agents-without-lowering-code-quality--i9s05ckia
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How to Use Test-Driven Development with AI Agents (Without Lowering Code Quality) | daily.dev
og:description: Two consultants, Marco Emmer and Ferdy Arbor, built a workflow called 'exact' that combines example mapping and test-driven development to keep AI-generated...
og:url: https://daily.dev/posts/how-to-use-test-driven-development-with-ai-agents-without-lowering-code-quality--i9s05ckia
og:image: https://api.daily.dev/og/posts/i9S05Ckia.png
og:image:alt: How to Use Test-Driven Development with AI Agents (Without Lowering Code Quality)
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Use Test-Driven Development with AI Agents (Without Lowering Code Quality)

**[Continuous Delivery](https://daily.dev/sources/continuousdelivery)** · 16 min read · 0 upvotes · 0 comments

## Summary

Two consultants, Marco Emmer and Ferdy Arbor, built a workflow called 'exact' that combines example mapping and test-driven development to keep AI-generated code quality high. In their experiments, doing example mapping before coding raised correctness by 60, 70%, 80% in some cases compared to giving an LLM a plain prose description. They also tested splitting TDD across sub agents, finding that a dedicated refactoring sub agent produced measurably better code quality, though the gap was larger with Opus 4.6 than with newer models. Their approach uses 'predictive TDD,' where the LLM predicts test outcomes before running them. The workflow and their test lab are open source on GitHub.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=a6HYpocKwXU>

## Questions this post answers

### Does doing example mapping before prompting an LLM actually improve code correctness?

Yes, example mapping before coding increased correctness by roughly 60 to 80% compared to giving an LLM only a prose problem description. This was measured by Marco Emmerick and Ferdinand Arbor using custom 'code katas' not present in LLM training data, comparing plain prose prompting against prompting preceded by example mapping.

_Anyone deciding how to prompt coding agents for correctness can track findings like this on daily.dev._

### What is predictive TDD and why does it help when working with an AI coding agent?

Predictive TDD means requiring a prediction of the outcome, such as the exact error message, before running each red, green or refactor step. Popularized by Ted M. Young's TDD game, it helps an LLM check whether it is still aligned with reality, since stating the prediction brings the problem to the front of the model's context.

_Developers refining their agentic TDD workflow can keep up with techniques like this on daily.dev._

### Does adding a separate sub agent for refactoring improve code quality when using Claude Code with TDD?

Yes, but the benefit has shrunk with newer models. Testing with Opus 4.6 showed a dedicated refactoring sub agent brought a lot of additional value in code quality metrics like cognitive complexity and mutation score; with Opus 5.5 and Claude Code, that gap narrowed, though a dedicated TDD approach still showed measurable benefit.

_Teams comparing single-agent versus multi-agent coding setups can follow results like these on daily.dev._

## Similar posts on daily.dev

- [Test-driven development ideal for AI, says Agile workshop](https://daily.dev/posts/test-driven-development-ideal-for-ai-says-agile-workshop-lp2mddokm) · The Register · 1 upvotes · 0 comments
- [How agile practices ensure quality in GenAI-assisted development](https://daily.dev/posts/how-agile-practices-ensure-quality-in-genai-assisted-development-9v75ajjmj) · InfoWorld · 0 upvotes · 0 comments
- [How do coding agents make TDD more practical?](https://daily.dev/posts/how-do-coding-agents-make-tdd-more-practical--jglmgl2sl) · LogRocket · 0 upvotes · 0 comments
- [TDD is more important than ever](https://daily.dev/posts/tdd-is-more-important-than-ever-hoeecbmpk) · Justin Searls · 118 upvotes · 8 comments

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#claude-code](https://daily.dev/tags/claude-code), [#tdd](https://daily.dev/tags/tdd)

[View this post on daily.dev](https://daily.dev/posts/how-to-use-test-driven-development-with-ai-agents-without-lowering-code-quality--i9s05ckia)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How to Use Test-Driven Development with AI Agents (Without Lowering Code Quality)","url":"https://daily.dev/posts/how-to-use-test-driven-development-with-ai-agents-without-lowering-code-quality--i9s05ckia","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-use-test-driven-development-with-ai-agents-without-lowering-code-quality--i9s05ckia"},"datePublished":"2026-11-04T19:23:27.456Z","dateModified":"2026-11-05T13:03:36.894Z","description":"Two consultants, Marco Emmer and Ferdy Arbor, built a workflow called 'exact' that combines example mapping and test-driven development to keep AI-generated...","image":"https://i.ytimg.com/vi/a6HYpocKwXU/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/a6HYpocKwXU/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Continuous Delivery","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Continuous Delivery","logo":"https://media.daily.dev/image/upload/s---b6TAqpH--/f_auto/v1730404995/logos/continuousdelivery","url":"https://daily.dev/sources/continuousdelivery"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-to-use-test-driven-development-with-ai-agents-without-lowering-code-quality--i9s05ckia","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-agents,claude-code,tdd","timeRequired":"PT16M","video":{"@type":"VideoObject","name":"How to Use Test-Driven Development with AI Agents (Without Lowering Code Quality)","description":"Two consultants, Marco Emmer and Ferdy Arbor, built a workflow called 'exact' that combines example mapping and test-driven development to keep AI-generated...","thumbnailUrl":"https://i.ytimg.com/vi/a6HYpocKwXU/sddefault.jpg","uploadDate":"2026-11-04T19:23:27.456Z","duration":"PT16M","url":"https://api.daily.dev/r/i9S05Ckia","embedUrl":"https://www.youtube.com/embed/a6HYpocKwXU"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Continuous Delivery","item":"https://daily.dev/sources/continuousdelivery"},{"@type":"ListItem","position":3,"name":"How to Use Test-Driven Development with AI Agents (Without Lowering Code Quality)"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/how-to-use-test-driven-development-with-ai-agents-without-lowering-code-quality--i9s05ckia#faq","mainEntity":[{"@type":"Question","name":"Does doing example mapping before prompting an LLM actually improve code correctness?","acceptedAnswer":{"@type":"Answer","text":"Yes, example mapping before coding increased correctness by roughly 60 to 80% compared to giving an LLM only a prose problem description. This was measured by Marco Emmerick and Ferdinand Arbor using custom 'code katas' not present in LLM training data, comparing plain prose prompting against prompting preceded by example mapping. Anyone deciding how to prompt coding agents for correctness can track findings like this on daily.dev."}},{"@type":"Question","name":"What is predictive TDD and why does it help when working with an AI coding agent?","acceptedAnswer":{"@type":"Answer","text":"Predictive TDD means requiring a prediction of the outcome, such as the exact error message, before running each red, green or refactor step. Popularized by Ted M. Young's TDD game, it helps an LLM check whether it is still aligned with reality, since stating the prediction brings the problem to the front of the model's context. Developers refining their agentic TDD workflow can keep up with techniques like this on daily.dev."}},{"@type":"Question","name":"Does adding a separate sub agent for refactoring improve code quality when using Claude Code with TDD?","acceptedAnswer":{"@type":"Answer","text":"Yes, but the benefit has shrunk with newer models. Testing with Opus 4.6 showed a dedicated refactoring sub agent brought a lot of additional value in code quality metrics like cognitive complexity and mutation score; with Opus 5.5 and Claude Code, that gap narrowed, though a dedicated TDD approach still showed measurable benefit. Teams comparing single-agent versus multi-agent coding setups can follow results like these on daily.dev."}}]}
```

