基于提示工程的软件测试用例生成方法研究
Research on Software Test Case Generation Method Based on Prompt Engineering
摘要: 软件测试用例的质量直接关系被测软件的质量。在当前大语言模型飞速发展的阶段,人们运用提示工程等关键技术来生成软件黑盒测试用例。然而,普遍存在生成的测试用例质量参差不齐,尤其异常场景测试用例无法完全契合实际测试需求的问题。因此,本文针对座舱显示控制软件进行了结构化提示词设计方法的研究。通过专家打分法以及结合软件代码缺陷检测率,对比不同结构化提示词因子组合下的测试用例生成效果,从而得出最佳结构化提示词,有效提升了软件测试用例的生成质量与效率。
Abstract: The quality of software test cases directly impacts the quality of the software under test. In the current era of rapid development of large language models, prompt engineering and other key technologies are being applied to generate black-box test cases. However, a common issue is the inconsistent quality of generated test cases, particularly in abnormal scenarios, which often fail to fully meet actual testing requirements. To address this, this study focuses on the research of structured prompt design methods for cockpit display control software. By comparing the effectiveness of different structured prompt factor combinations in test case generation through expert scoring and software code defect detection rates, the optimal structured prompt is derived, effectively improving the quality and efficiency of software test case generation.
文章引用:王媛, 韩启, 张絮, 杨丰辉. 基于提示工程的软件测试用例生成方法研究[J]. 嵌入式技术与智能系统, 2025, 2(5): 330-336. https://doi.org/10.12677/etis.2025.25032

参考文献

[1] 王延永, 黄松. 测试用例自动生成技术综述[J]. 电子技术与软件工程, 2021(18): 51-53.
[2] 杨波, 吴际等. 一种软件测试需求建模及测试用例生成方法[J]. 计算机学报, 2014, 37(3): 522-538.
[3] 黄峻, 林飞等. 生成式AI的大模型提示工程: 方法、现状与展望[J]. 智能科学与技术学报, 2014, 6(2): 115-133.
[4] 刘硕, 林荣超. 综合座舱显示控制系统的设计与实现[J]. 现代电子技术, 2010, 33(15): 160-162.
[5] 王华荣, 宁伟. 综合显示控制系统的设计与实现[J]. 科技资讯, 2011(11): 36.
[6] 中国人民解放军总装备部司令部. 军用软件测试指南: TE-BTCG-00302021[S]. 北京: 总装备部军标出版发行部, 2021.