A^3-CodGen: A Repository-Level Code Generation Framework for Code Reuse with Local-Aware, Global-Aware, and Third-Party-Library-Aware

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Liao, Dianshu, Pan, Shidong, Sun, Xiaoyu, Ren, Xiaoxue, Huang, Qing, Xing, Zhenchang, Jin, Huan, Li, Qinying
Format: Preprint
Published: 2023
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912088772837376
author Liao, Dianshu
Pan, Shidong
Sun, Xiaoyu
Ren, Xiaoxue
Huang, Qing
Xing, Zhenchang
Jin, Huan
Li, Qinying
author_facet Liao, Dianshu
Pan, Shidong
Sun, Xiaoyu
Ren, Xiaoxue
Huang, Qing
Xing, Zhenchang
Jin, Huan
Li, Qinying
contents 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 A^3-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 A^3-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.
format Preprint
id arxiv_https___arxiv_org_abs_2312_05772
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle A^3-CodGen: A Repository-Level Code Generation Framework for Code Reuse with Local-Aware, Global-Aware, and Third-Party-Library-Aware
Liao, Dianshu
Pan, Shidong
Sun, Xiaoyu
Ren, Xiaoxue
Huang, Qing
Xing, Zhenchang
Jin, Huan
Li, Qinying
Software Engineering
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 A^3-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 A^3-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.
title A^3-CodGen: A Repository-Level Code Generation Framework for Code Reuse with Local-Aware, Global-Aware, and Third-Party-Library-Aware
topic Software Engineering
url https://arxiv.org/abs/2312.05772