arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.05239cs.SEcs.AI
收藏

对AI生成代码中bug的综述

A Survey of Bugs in AI-Generated Code

\ School of Mathematical;Computational Sciences, Massey University Palmerston North New Zealand;Computational Sciences, Massey University New Zealand;School of Computer Science, Wuhan University China;SWAT Laboratory, Polytechnique Montr\'eal Canada;School of Mathematical;Computational Sciences, Massey University;School of Computer Science, Wuhan University;SWAT Laboratory, Polytechnique Montr\'eal

Ruofan Gao, Amjed Tahir, Peng Liang, Teo Susnjak, Ali Soltanian Fard Jahromi, Foutse Khomh

AI总结:

本文系统综述了AI生成代码中的bug问题,分析了bug类型、分布及修复策略,为未来模型改进和质量评估提供参考。

摘要:

开发者广泛使用AI代码生成模型,旨在提高生产力和效率。然而,AI生成的代码也存在质量担忧。生成的代码由在公共可用代码上训练的模型生成,这些代码已知包含bug和质量问题。这些问题会在开发过程中造成信任和维护挑战。有关AI生成代码的质量问题已有多项报告,包括bug和缺陷。然而,这些发现往往零散且缺乏系统性总结。目前缺乏全面的回顾来揭示这些错误的类型和分布、可能的修复策略以及它们与特定模型的相关性。在本文中,我们系统地分析现有的AI生成代码文献,以建立对生成代码中bug和缺陷的整体理解,为未来模型改进和质量评估提供参考。我们旨在了解AI生成代码中bug的性质和范围,并提供不同模型生成代码中存在的bug类型和模式的分类。我们还讨论了可能的修复和缓解策略,以消除生成代码中的bug。

英文摘要:

AI coding systems are increasingly used to help developers write code at scale, improving software development efficiency and boosting productivity. While these models and agents have shown strong performance, concerns persist regarding the quality of the AI-generated code. Although prior work has reported a range of quality issues associated with AI-generated code, these findings remain scattered and lack a systematic synthesis. A comprehensive review is lacking that demonstrates the bug types, patterns, distribution, their correlation with specific AI coding systems, and the remediation strategies proposed to address them. To fill this gap, we conduct a systematic literature review of existing studies on AI-generated code to develop a comprehensive understanding of bugs in the generated code and provide a foundation for future improvements in AI-assisted coding. Our results show that bugs are widespread in AI-generated code, with functional and stability bugs emerging as the most frequently reported categories across the reviewed studies, a substantial proportion of which is attributed to model hallucination. Model size, instruction-following capability, and the quality and diversity of training data are key factors influencing bug occurrence. To mitigate bugs, prompt engineering techniques are widely used; however, certain domain-specific or semantically complex issues remain difficult to resolve automatically and still require human intervention.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑