Automated unit test generation is critical for software quality but traditional structure-driven methods often lack the semantic understanding required to produce realistic inputs and oracles. Large language models (LLMs) address this limitation by leveraging their extensive data-driven knowledge of code semantics and programming patterns. To analyze the state of the art in this domain, we conducted a systematic literature review of 115 publications published between May 2021 and August 2025. We propose a taxonomy based on the unit test generation lifecycle that divides the process into a generative phase for creating test artifacts and a quality assurance phase for refining them. Our analysis reveals that prompt engineering has emerged as the dominant utilization approach and accounts for 89% of the studies due to its flexibility. We find that iterative validation and repair loops have become the standard mechanism to ensure robust usability by significantly improving compilation and execution pass rates. However, critical challenges remain regarding the weak fault detection capabilities and the lack of standardized benchmarks. We conclude with a roadmap for future research that emphasizes the progression toward autonomous testing agents and hybrid systems combining LLMs with traditional software engineering tools.


翻译:自动化单元测试生成对于软件质量至关重要,但传统的结构驱动方法往往缺乏生成真实输入与断言所需的语义理解能力。大语言模型(LLMs)通过利用其基于海量数据驱动的代码语义和编程模式知识,有效解决了这一局限。为分析该领域的研究现状,我们对2021年5月至2025年8月期间发表的115篇文献进行了系统性综述。我们提出了一个基于单元测试生成生命周期的分类框架,将生成过程划分为创建测试制品的生成阶段与优化制品的质量保障阶段。分析表明,提示工程因其灵活性已成为主导应用方式,在相关研究中占比达89%。研究发现,迭代验证与修复循环已成为确保生成结果稳健可用的标准机制,能显著提升编译与执行通过率。然而,当前仍存在故障检测能力薄弱、缺乏标准化基准等关键挑战。最后,我们提出了未来研究的路线图,强调应朝着自主测试代理、以及大语言模型与传统软件工程工具相结合的混合系统方向发展。

0
下载
关闭预览

相关内容

大语言模型中的检索与结构化增强生成综述
专知会员服务
32+阅读 · 2025年9月17日
赋能大型语言模型多领域资源挑战
专知会员服务
10+阅读 · 2025年6月10日
面向统计学家的大型语言模型概述
专知会员服务
32+阅读 · 2025年3月16日
大型语言模型在生物信息学中的应用综述
专知会员服务
16+阅读 · 2025年3月15日
《大型语言模型代码生成》综述
专知会员服务
68+阅读 · 2024年6月4日
「大型语言模型评测」综述
专知会员服务
70+阅读 · 2024年3月30日
大型语言模型在预测和异常检测中的应用综述
专知会员服务
70+阅读 · 2024年2月19日
大语言模型简明指南
专知会员服务
143+阅读 · 2023年7月29日
自然语言处理中的语言模型预训练方法
PaperWeekly
14+阅读 · 2018年10月21日
NLP通用模型诞生?一个模型搞定十大自然语言常见任务
人工智能头条
10+阅读 · 2018年6月29日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
12+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Arxiv
0+阅读 · 1月18日
VIP会员
相关VIP内容
大语言模型中的检索与结构化增强生成综述
专知会员服务
32+阅读 · 2025年9月17日
赋能大型语言模型多领域资源挑战
专知会员服务
10+阅读 · 2025年6月10日
面向统计学家的大型语言模型概述
专知会员服务
32+阅读 · 2025年3月16日
大型语言模型在生物信息学中的应用综述
专知会员服务
16+阅读 · 2025年3月15日
《大型语言模型代码生成》综述
专知会员服务
68+阅读 · 2024年6月4日
「大型语言模型评测」综述
专知会员服务
70+阅读 · 2024年3月30日
大型语言模型在预测和异常检测中的应用综述
专知会员服务
70+阅读 · 2024年2月19日
大语言模型简明指南
专知会员服务
143+阅读 · 2023年7月29日
相关基金
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
12+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员