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.
翻译:背景:以大型语言模型(LLMs)为代表的AI辅助代码生成工具的快速应用,正在深刻改变软件开发实践。尽管这些工具可显著提升生产力,但学术界与工业界对AI生成代码的质量、可靠性和安全性问题的关注正日益增加。目的:本研究旨在系统性地综合现有关于影响AI生成源代码质量因素的实证证据,并分析这些因素在不同评估情境下对软件质量结果的影响。方法:我们遵循既定指南开展系统文献综述(SLR),采用人工监督的AI辅助工作流程。通过对主流数字图书馆的结构化检索与筛选,共纳入24篇原始研究。采用基于模式的定性证据综合方法进行数据提取与分析。结果:研究结果表明,AI辅助开发中的代码质量受人类因素、AI系统特征及人机交互动态多维度复合影响,关键因素包括提示设计、任务规范及开发者专业水平。结果还显示,不同研究中代码的正确性、安全性、可维护性和复杂性等质量结果存在差异,同时报告了改进效果与潜在风险。结论:AI辅助代码生成代表了软件工程中的社会技术性变革,实现高质量产出需兼顾技术因素与人类因素。尽管前景广阔,但AI生成代码仍需审慎验证并融入开发工作流程。