arXiv:2603.25146cs.SEcs.AI2026-03

梳理影响代码生成质量的关键因素,揭示人与AI协作的复杂性。

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

  • 通过系统综述24项研究,分析人、AI系统与交互方式对代码质量的影响
  • 提示设计、任务描述和开发者经验显著影响生成代码的正确性与安全性
  • 适合关注AI编程工具落地的开发者与研发管理者阅读

背景:大型语言模型(LLMs)等AI辅助代码生成工具正迅速改变软件开发实践。尽管这类工具有望大幅提升生产力,但其生成代码的质量、可靠性与安全性问题在学术界和产业界日益受到关注。目标:本研究旨在系统合成现有实证证据,探究影响AI生成源代码质量的因素,并分析这些因素在不同评估情境下的软件质量影响。方法:遵循既定指南开展系统文献回顾(SLR),辅以人工智能辅助工作流并由人工监督。通过结构化搜索与筛选流程,从主要数字图书馆中选取24项原始研究。采用基于模式的定性证据综合法提取与分析数据。结果:研究发现,AI辅助开发中的代码质量受人类因素、AI系统特性及人机交互动态共同影响。关键因素包括提示设计、任务说明和开发者专业水平。结果还显示,不同研究中代码质量表现(如正确性、安全性、可维护性、复杂度)存在差异,既有提升也有风险。结论:AI辅助代码生成是软件工程领域的社会技术变革,高质量产出依赖技术和人为因素的协同。尽管前景广阔,仍需谨慎验证并融入开发流程。

原文摘要 · Abstract (English)

Context: The rapid adoption of AI-assisted code generation tools, such as large language models (LLMs), is transforming software development practices. While these tools promise significant productivity gains, concerns regarding the quality, reliability, and security of AI-generated code are increasingly reported in both academia and industry. --Objective: This study aims to systematically synthesize existing empirical evidence on the factors influencing the quality of AI-generated source code and to analyze how these factors impact software quality outcomes across different evaluation contexts. --Method: We conducted a systematic literature review (SLR) following established guidelines, supported by an AI-assisted workflow with human oversight. A total of 24 primary studies were selected through a structured search and screening process across major digital libraries. Data were extracted and analyzed using qualitative, pattern-based evidence synthesis. --Results: The findings reveal that code quality in AI-assisted development is influenced by a combination of human factors, AI system characteristics, and human AI interaction dynamics. Key influencing factors include prompt design, task specification, and developer expertise. The results also show variability in quality outcomes such as correctness, security, maintainability, and complexity across studies, with both improvements and risks reported. --Conclusion: AI-assisted code generation represents a socio-technical shift in software engineering, where achieving high-quality outcomes depends on both technological and human factors. While promising, AI-generated code requires careful validation and integration into development workflows.

代码生成AI辅助开发软件质量人机协作

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。