arXiv:cs.AI· Yiran Hu, Shanchao Liang, Nan Jiang, Yi Wu, Lin Tan·· 21 小时前
TENET:面向仓库级代码生成的测试驱动开发框架
TENET: One Step Toward Test-Driven Development for Repository-Level Code Generation
AI 导读
TENET 是一个面向仓库级代码生成的智能体框架,将开发者编写的测试作为可执行规格来驱动代码合成。在 Claude Sonnet 4 上,TENET 于 RepoCod 和 RepoEval 分别取得 69.08% 和 81.77% 的 Pass@1,较最强基线提升 9.49 和 2.17 个百分点。该工作还首次系统研究了测试套件特征如何影响 LLM 智能体在 TDD 场景下的表现。
正文
Abstract:Test-Driven Development (TDD) is a widely adopted practice that requires developers to create and execute tests alongside implementation. With recent advances in Large Language Models (LLMs), developers can shift from manually writing the code to defining tests as executable specifications and delegating code synthesis to AI agents. However, enabling repository-level TDD under developer-written tests is challenging, requiring: (1) specification enhancement: identifying a concise yet representative test subset from large suites with rich task semantics; (2) retrieval augmentation: using tests to guide reasoning and context retrieval; and (3) test-driven refinement: interpreting test feedback for iterative improvement. We propose TENET, an agentic framework for repository-level code generation under the TDD paradigm. TENET includes: (1) a test harness mechanism that selects a concise test suite to maximize diversity of the target usage scenarios; (2) a tailored agent toolset for efficient retrieval and debugging; and (3) a reflection-based refinement workflow that iteratively analyzes failures and updates implementations. TENET consistently outperforms the strongest baselines across backbones, achieving 69.08% and 81.77% Pass@1 on RepoCod and RepoEval with Claude Sonnet 4, improving by 9.49 and 2.17 percentage points, respectively. Additionally, we present the first systematic study of how test suite characteristics influence LLM agent performance in TDD settings.
| Comments: | Accepted at the 37th IEEE International Symposium on Software Reliability Engineering (ISSRE 2026) |
| Subjects: | Software Engineering (cs.SE); Artificial Intelligence (cs.AI) |
| ACM classes: | D.2.5; I.2.2 |
| Cite as: | arXiv:2509.24148 [cs.SE] |
| (or arXiv:2509.24148v5 [cs.SE] for this version) | |
| https://doi.org/10.48550/arXiv.2509.24148 arXiv-issued DOI via DataCite |
Submission history
From: Yiran Hu [view email]
[v1]
Mon, 29 Sep 2025 00:53:16 UTC (2,012 KB)
[v2]
Tue, 30 Sep 2025 04:05:32 UTC (2,012 KB)
[v3]
Sun, 12 Jul 2026 23:05:42 UTC (806 KB)
[v4]
Thu, 13 Aug 2026 19:04:55 UTC (736 KB)
[v5]
Sun, 11 Oct 2026 18:23:18 UTC (733 KB)
来源:arXiv:cs.AI · arxiv.org