Metraipolis › archive › dc_39cbac9fc2a3
TDD-Agent: Test-Driven Reasoning for Code Generation — arXiv:2608.16742
- Source
- arXiv (en)
- Original
- https://arxiv.org/abs/2608.16742
- License (as archived)
- CC0-1.0
- Archived
- 2026-10-18T18:07:31.457Z
- SHA-256 of the archived text
545cf6e678481afa790a2eb97427ee6c9c67d4f49de7346fb46e6319a1e85f09- Stable URL of this page
https://metraipolis.com/documento/dc_39cbac9fc2a3
How to cite
TDD-Agent: Test-Driven Reasoning for Code Generation — arXiv:2608.16742 — arXiv (en), https://arxiv.org/abs/2608.16742 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_39cbac9fc2a3 (Metraipolis archive dc_39cbac9fc2a3, sha256 545cf6e678481afa790a2eb97427ee6c9c67d4f49de7346fb46e6319a1e85f09)
BibTeX
@misc{dc39cbac9fc2a3,
title = {TDD-Agent: Test-Driven Reasoning for Code Generation — arXiv:2608.16742},
howpublished = {arXiv (en)},
url = {https://arxiv.org/abs/2608.16742},
note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_39cbac9fc2a3; sha256 545cf6e678481afa790a2eb97427ee6c9c67d4f49de7346fb46e6319a1e85f09},
year = {2026}
}Archived text
Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2608.16742. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
Large Language Models (LLMs) have achieved remarkable progress in code generation, yet ensuring correctness in complex, repository-level tasks remains challenging. Existing approaches often use generated tests as static post-hoc validators, which limits their ability to guide implementation and may introduce misleading feedback when the tests themselves are incomplete or incorrect. In this paper, we introduce TDD-Agent, which operationalizes the test-driven development paradigm for code generation. TDD-Agent first prompts the model to generate executable tests, encouraging it to clarify expected behaviors before implementation, and then performs iterative dual-track refinement over both the generated code and tests using execution feedback. We first isolate the effect of test-first reasoning through a prompt variant TDD-prompt on LiveCodeBench, where it consistently improves upon reasoning-based prompting baselines. Building on this finding, we evaluate the full TDD-Agent framework on RepoEval, a repository-level benchmark, and show that it consistently outperforms retrieval-based and agent-based baselines. Additional analyses show that iterative refinement improves not only code correctness but also the effectiveness of the generated tests, yielding higher pass rates, coverage, and mutation scores, suggesting that tests can serve as evolving reasoning artifacts rather than fixed validators. Our source code is available at this https URL . Tema degli esploratori: agenti e intelligenza artificiale (retro-catalogo arXiv: annunci del 2026-08-18 in cs.AI). Categorie arXiv: Software Engineering (cs.SE) ; Artificial Intelligence (cs.AI). Pagina del lavoro: https://arxiv.org/abs/2608.16742 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito). Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina. Letto il 2026-10-18T16:29:14.149Z dalla pagina https://arxiv.org/catchup/cs.AI/2026-08-18?abs=True (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).