TICoder: A Repository-Level Code Generation Framework with Test-Driven Planning and Implementation-Aware Reuse
- URL: http://arxiv.org/abs/2606.08135v1
- Date: Sat, 06 Jun 2026 12:23:30 GMT
- Title: TICoder: A Repository-Level Code Generation Framework with Test-Driven Planning and Implementation-Aware Reuse
- Abstract summary: We propose TICoder, a novel repository-level code generation framework that improves both planning and reuse.<n> TICoder introduces a test-driven iterative planning mechanism that leverages test cases as behavioral specifications to refine implementation steps.<n>We then identify relevant usage patterns through a dual-stage selection strategy, combining structure-based clustering and perplexity-based filtering.
- Score: 6.560303090465954
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: Repository-level code generation with Large Language Models (LLMs) remains challenging, primarily due to complex dependencies and limited context windows. Recent approaches adopt retrieval-augmented generation (RAG) and the planning mechanism to reuse potential callee functions in the repository. However, these approaches often suffer from two limitations: lack of test-driven behavioral guidance during planning and overlooking the implementation logic embedded in repository code during reuse. As a result, generated plans may not align with expected behaviors, and retrieved functions may not be effectively reused. In this paper, we propose TICoder, a novel repository-level code generation framework that improves both planning and reuse. TICoder introduces a test-driven iterative planning mechanism that leverages test cases as behavioral specifications to refine implementation steps. Furthermore, TICoder employs an implementation-aware code reuse strategy, which retrieves potential callee functions using a dual-view similarity that captures both functional and implementation aspects. We then identify relevant usage patterns through a dual-stage selection strategy, combining structure-based clustering and perplexity-based filtering. We conduct extensive experiments on widely used repository-level code generation benchmarks with various LLMs. Experimental results demonstrate that TICoder outperforms state-of-the-art (SOTA) methods, achieving an average improvement of 11.52%.
Related papers
- Understanding by Reconstruction: Reversing the Software Development Process for LLM Pretraining [66.89012795621349]
Large Language Models (LLMs) often struggle with the deep, long-horizon reasoning required for complex software engineering.<n>We propose a novel paradigm: understanding via reconstruction.<n>We introduce a framework that synthesizes latent agentic trajectories using a multi-agent simulation.
arXiv Detail & Related papers (2026-03-11T09:23:20Z) - Do Not Treat Code as Natural Language: Implications for Repository-Level Code Generation and Beyond [13.550121154853715]
We present Hydra, a repository-level code generation framework that treats code as structured code rather than natural language.<n>We show that Hydra achieves state-of-the-art performance across open- and closed-source CodeLLMs.
arXiv Detail & Related papers (2026-02-12T07:44:00Z) - Generative Actor Critic [74.04971271003869]
Generative Actor Critic (GAC) is a novel framework that decouples sequential decision-making by reframing textitpolicy evaluation as learning a generative model of the joint distribution over trajectories and returns.<n>Experiments on Gym-MuJoCo and Maze2D benchmarks demonstrate GAC's strong offline performance and significantly enhanced offline-to-online improvement compared to state-of-the-art methods.
arXiv Detail & Related papers (2025-12-25T06:31:11Z) - UCRBench: Benchmarking LLMs on Use Case Recovery [42.35653533011503]
We introduce code-aligned use case benchmarks, constructed through manual validation of both user-goal and subfunction use cases.<n>We conduct the first systematic study of large language models (LLMs) and propose a hierarchical evaluation protocol.<n>The results show that while LLMs can partially reconstruct system functionality, their performance varies significantly across projects.
arXiv Detail & Related papers (2025-12-15T14:12:57Z) - RepoScope: Leveraging Call Chain-Aware Multi-View Context for Repository-Level Code Generation [16.544483144957407]
RepoScope is a call chain-aware multi-view context for repository-level code generation.<n>We present a novel call chain prediction method that utilizes the repository's structural semantics to improve the identification of callees in the target function.<n>RepoScope outperforms state-of-the-art methods, achieving up to a 36.35% relative improvement in pass@1 scores.
arXiv Detail & Related papers (2025-07-20T02:35:36Z) - Enhancing LLM Code Generation: A Systematic Evaluation of Multi-Agent Collaboration and Runtime Debugging for Improved Accuracy, Reliability, and Latency [0.0]
We study how different programming activities compositions and training paradigms influence code generation effectiveness.<n>Our findings provide valuable insights for organizations seeking robust AI-driven coding solutions.
arXiv Detail & Related papers (2025-05-04T14:44:27Z) - PERC: Plan-As-Query Example Retrieval for Underrepresented Code Generation [20.105490443135672]
Plan-as-query Example Retrieval for few-shot prompting in Code generation (PERC)<n>PERC consistently outperforms the state-of-the-art RAG methods in code generation.
arXiv Detail & Related papers (2024-12-17T01:23:45Z) - Binary Code Similarity Detection via Graph Contrastive Learning on Intermediate Representations [52.34030226129628]
Binary Code Similarity Detection (BCSD) plays a crucial role in numerous fields, including vulnerability detection, malware analysis, and code reuse identification.
In this paper, we propose IRBinDiff, which mitigates compilation differences by leveraging LLVM-IR with higher-level semantic abstraction.
Our extensive experiments, conducted under varied compilation settings, demonstrate that IRBinDiff outperforms other leading BCSD methods in both One-to-one comparison and One-to-many search scenarios.
arXiv Detail & Related papers (2024-10-24T09:09:20Z) - Hierarchical Reinforcement Learning for Temporal Abstraction of Listwise Recommendation [51.06031200728449]
We propose a novel framework called mccHRL to provide different levels of temporal abstraction on listwise recommendation.<n>Within the hierarchical framework, the high-level agent studies the evolution of user perception, while the low-level agent produces the item selection policy.<n>Results observe significant performance improvement by our method, compared with several well-known baselines.
arXiv Detail & Related papers (2024-09-11T17:01:06Z) - Tractable Offline Learning of Regular Decision Processes [50.11277112628193]
This work studies offline Reinforcement Learning (RL) in a class of non-Markovian environments called Regular Decision Processes (RDPs)
Ins, the unknown dependency of future observations and rewards from the past interactions can be captured experimentally.
Many algorithms first reconstruct this unknown dependency using automata learning techniques.
arXiv Detail & Related papers (2024-09-04T14:26:58Z) - R2C2-Coder: Enhancing and Benchmarking Real-world Repository-level Code Completion Abilities of Code Large Language Models [62.20537000942005]
We propose the R2C2-Coder to enhance and benchmark the real-world repository-level code completion abilities of code Large Language Models.<n>R2C2-Coder includes a code prompt construction method R2C2-Enhance and a well-designed benchmark R2C2-Bench.
arXiv Detail & Related papers (2024-06-03T14:24:29Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.