cs.SEDec 4, 2025

A Survey of Bugs in AI-Generated Code

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

Organizations: School of Mathematical and Computational Sciences, Massey University, New Zealand · School of Computer Science, Wuhan University, China · SWAT Laboratory, Polytechnique Montréal, Canada

Abstract

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.

Figures & tables

Appendix figures & tables2 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Factors Influencing the Quality of AI-Generated Code: A Synthesis of Empirical Evidence

    Mar 26, 2026Vehid Geruslu, Zulfiyya Aliyeva, Eray TüzünAI-Assisted Software DevelopmentCode Generation Evaluation

  2. AIRA: AI-Induced Risk Audit: A Structured Inspection Framework for AI-Generated Code

    Apr 19, 2026William M. ParrisLLM AuditingStatic Code Analysis

  3. What is the Difference Between Me and You? Benchmarking the Quality Gap Between Human-Written and AI-Generated Code

    Sep 11, 2026Cristina Improta, Pietro Liguori, Domenico CotroneoLLM SecurityCode Generation Evaluation