mlsanityData to 14 Oct 2026

TDD-Agent: Test-Driven Reasoning for Code Generation

arXiv 2608.16742 ↗First posted 17 Aug 2026cs.SE cs.AIcited by 2

On the map: LLM reasoning → Reasoning for agents, planning and code

also in 1 more
Abstract (arXiv)

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 https://anonymous.4open.science/r/TDD-Agent-Framework-6370/.

Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 18 of its 37 references that are in the map. First posted on arXiv 17 Aug 2026.

Builds on

18 of 37 references.

Closest ancestors · 1

Same direction, newest first

  1. 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Code12 Mar

Other references · 17

  1. 2023GPT-4 Technical Reportcited by 18,396
  2. 2024The Llama 3 Herd of Modelscited by 14,715
  3. 2025Qwen3 Technical Reportcited by 8,820
  4. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  5. 2021Program Synthesis with Large Language Modelscited by 3,637
  6. 2024Qwen2 Technical Reportcited by 2,120
  7. 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agentscited by 1,002
  8. 2024Gemma: Open Models Based on Gemini Research and Technologycited by 916
  9. 2023Gemini: A Family of Highly Capable Multimodal Modelscited by 872
  10. 2025DeepSeek-V3.2: Pushing the Frontier of Open Large Language Modelscited by 815
  11. 2024Agentless: Demystifying LLM-based Software Engineering Agentscited by 421
  12. 2022ReACC: A Retrieval-Augmented Code Completion Frameworkcited by 119
5 more
  1. 2023AgentCoder: Multi-Agent-based Code Generation with Iterative Testing and Optimisationcited by 35
  2. 2025CoCoEvo: Co-Evolution of Programs and Test Cases to Enhance Code Generationcited by 14
  3. 2025TENET: One Step Toward Test-Driven Development for Repository-Level Code Generationcited by 2
  4. 2025Intention Chain-of-Thought Prompting with Dynamic Routing for Code Generationcited by 2
  5. 2025Completion by Comprehension: Guiding Code Generation with Multi-Granularity Understandingcited by 1

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 2.

2 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2024SWT-Bench: Testing and Validating Real-World Bug-Fixes with Code Agents
  2. 2026Agent-Based Test Assertion Generation via Diverse Perspective Aggregation
  3. 2026TDD Governance for Multi-Agent Code Generation via Prompt Engineering
  4. 2024Large Language Models as Test Case Generators: Performance Evaluation and Enhancement
  5. 2025textttReMind: Understanding Deductive Code Reasoning in LLMs
  6. 2024RGD: Multi-LLM Based Agent Debugger via Refinement and Generation Guidance
  7. 2026Grounding AI Agents in Contracts: An Empirical Evaluation of Spec-Driven Test Generation
  8. 2026E2E-SWE: Benchmarking LLMs on Building Working Codebases from Scratch