Agentic AI
New AI Framework Adopts Test-Driven Development for Large Repository Code Generation
TENET, an agentic system, uses developer-written tests to guide AI agents in generating code across entire software repositories, achieving strong improvements over prior baselines.
A research paper from arXiv's Software Engineering track introduces TENET, an AI framework designed to apply test-driven development (TDD) principles to repository-level code generation. Rather than asking language models to generate code from scratch, TENET uses developer-written tests as executable specifications to guide the AI agents through the process.
The Challenge of TDD at Scale#
Adapting TDD to large codebases presents three major hurdles. First, test suites in real projects can be enormous—identifying which tests are most meaningful to focus on is non-trivial. Second, the AI system must use those tests intelligently to retrieve relevant code context and reason about what to build. Third, when tests fail, the system needs to understand the feedback and refine its implementation accordingly.
How TENET Works#
The framework tackles these challenges through three main mechanisms:
- Specification enhancement: A test harness automatically selects a lean, representative subset of tests that covers diverse usage scenarios, preventing the agent from being overwhelmed by thousands of test cases.
- Retrieval augmentation: Tests inform the system's retrieval and reasoning processes, helping it fetch the right context from the repository and understand what functionality is needed.
- Reflection-based refinement: When tests fail, TENET analyzes the failures and iteratively updates the code implementation based on the feedback loop.
Empirical Results#
On two standard benchmarks—RepoCod and RepoEval—TENET achieved 69.08% and 81.77% success rates respectively when paired with Claude Sonnet 4, outperforming the strongest prior baselines by 9.49 and 2.17 percentage points. The research also presents the first systematic analysis of how test suite characteristics affect AI agent performance in TDD scenarios.

