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

LLM生成代码的质量保障:解决非功能性质量特性

Quality Assurance of LLM-generated Code: Addressing Non-Functional Quality Characteristics

Department of Computer and Information Science, Linköping University, Sweden(Linköping大学计算机与信息科学系)

Xin Sun, Daniel Ståhl, Kristian Sandahl, Christoph Kessler

AI总结:

研究通过文献综述、行业研讨会和实证分析,探讨LLM生成代码在安全、可维护性和性能效率等非功能性质量特性上的表现,揭示学术研究与行业需求的不匹配,强调需在代码生成流程中集成质量保障机制。

摘要:

近年来,大语言模型被广泛集成到软件工程流程中,支持代码生成等任务。尽管以往评估侧重功能性正确性,但生成代码的非功能性质量特性仍缺乏深入理解。本文基于ISO/IEC 25010质量模型,采用文献综述、行业研讨会和实证分析三种方法,研究生成补丁在安全、可维护性和性能效率等关键代码质量属性上的表现。研究发现,现有研究主要关注安全、性能效率和可维护性,而其他质量属性研究不足。相比之下,从业者更重视可维护性和可读性,警告生成代码可能加速技术债务积累。实证评估显示,在实际软件工程环境中,通过提示优化非功能性质量特性存在不稳定性。总体而言,研究揭示了学术焦点、行业需求和模型行为之间的不匹配,强调需在LLM代码生成流程中集成质量保障机制,以确保未来生成的代码不仅通过测试,更具备真正的质量。

英文摘要:

In recent years, large language models have been widely integrated into software engineering workflows, supporting tasks like code generation. While prior evaluations focus on functional correctness, there is still a limited understanding of the non-functional quality characteristics of generated code. Guided by the ISO/IEC 25010 quality model, this study adopts a multi-methods approach comprising three complementary elements: a literature review of 109 papers, two industry workshops with practitioners from multiple organizations, and an empirical analysis of patching real-world software issues using three LLMs. Motivated by insights from both the literature and practitioners, the empirical study examined the quality of generated patches regarding security, maintainability, and performance efficiency, which were identified as critical code-level quality attributes. Our results indicate that existing research primarily emphasizes security, performance efficiency, and maintainability, while other quality attributes are understudied. In contrast, practitioners prioritize maintainability and readability, warning that generated code may accelerate the accumulation of technical debt. The empirical evaluation demonstrates the instability of optimizing NFQCs through prompts in practical software engineering settings. Overall, our findings expose a misalignment between academic focus, industry priorities, and observed model behavior, highlighting the need to integrate quality assurance mechanisms into LLM code generation pipelines to ensure that future generated code not only passes tests but truly passes with quality.

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

↑