A3-CodGen: A Repository-Level Code Generation Framework for Code Reuse With Local-Aware, Global-Aware, and Third-Party-Library-Aware

LLM-based code generation tools are essential to help developers in the software development process. Existing tools often disconnect with the working context, i.e., the code repository, causing the generated code to be not similar to human developers. In this paper, we propose a novel code generation framework, dubbed <inline-formula><tex-math notation="LaTeX">$A^{3}$</tex-math></inline-formula>-CodGen, to harness information within the code repository to generate code with fewer potential logical errors, code redundancy, and library-induced compatibility issues. We identify three types of representative information for the code repository: local-aware information from the current code file, global-aware information from other code files, and third-party-library information. Results demonstrate that by adopting the <inline-formula><tex-math notation="LaTeX">$A^{3}$</tex-math></inline-formula>-CodGen framework, we successfully extract, fuse, and feed code repository information into the LLM, generating more accurate, efficient, and highly reusable code. The effectiveness of our framework is further underscored by generating code with a higher reuse rate, compared to human developers. This research contributes significantly to the field of code generation, providing developers with a more powerful tool to address the evolving demands in software development in practice.

Authors

Institutions

Publication Details

Journal
IEEE Transactions on Software Engineering
Published
2024-10-24
DOI
https://doi.org/10.1109/tse.2024.3486195
Citations
13
Primary Topic
Software Testing and Debugging Techniques
Type
article
Field-Weighted Citation Impact
6.31
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A3-CodGen: A Repository-Level Code Generation Framework for Code Reuse With Local-Aware, Global-Aware, and Third-Party-Library-Aware

Dianshu Liao, Zhenchang Xing, Xiaoxue Ren, Qing Huang et al.
13 citations
IEEE Transactions on Software Engineering
Software Testing and Debugging Techniques
6.31
article

A3-CodGen: A Repository-Level Code Generation Framework for Code Reuse With Local-Aware, Global-Aware, and Third-Party-Library-Aware

Dianshu Liao, Zhenchang Xing, Xiaoxue Ren, Qing Huang, Xiaoyu Sun, Shidong Pan, Qinying Li, Huan Jin
article en
13 citations

Abstract

LLM-based code generation tools are essential to help developers in the software development process. Existing tools often disconnect with the working context, i.e., the code repository, causing the generated code to be not similar to human developers. In this paper, we propose a novel code generation framework, dubbed <inline-formula><tex-math notation="LaTeX">$A^{3}$</tex-math></inline-formula>-CodGen, to harness information within the code repository to generate code with fewer potential logical errors, code redundancy, and library-induced compatibility issues. We identify three types of representative information for the code repository: local-aware information from the current code file, global-aware information from other code files, and third-party-library information. Results demonstrate that by adopting the <inline-formula><tex-math notation="LaTeX">$A^{3}$</tex-math></inline-formula>-CodGen framework, we successfully extract, fuse, and feed code repository information into the LLM, generating more accurate, efficient, and highly reusable code. The effectiveness of our framework is further underscored by generating code with a higher reuse rate, compared to human developers. This research contributes significantly to the field of code generation, providing developers with a more powerful tool to address the evolving demands in software development in practice.

IEEE Transactions on Software EngineeringVol. 50(12)
Australian National University (AU), Commonwealth Scientific and Industrial Research Organisation (AU), Jiangxi University of Technology (CN), Data61 (AU), Jiangxi Normal University (CN), Zhejiang University (CN)
Openalex Percentile: Top 3%
Software Testing and Debugging Techniques
6.31
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.