摘要
针对基础大模型生成测试用例的可执行性、正确性、与需求对齐性、覆盖率低下的问题,提出一种基于检索增强生成、提示语工程、大模型微调的改进方法。首先,将检索增强生成与大模型语言相结合,使大模型的生成结果有外部数据的补充;其次,建立提示词优化系统,利用动态提示调整、提示语模板化使输出结果更准确;最后,进一步微调预训练语言模型,但仅微调少量的嵌入词,而非大规模更新模型参数来减少资源投入。实验表明,所提方法相较于基础大模型在可执行性、正确性、需求对齐性、需求覆盖率上分别提升27.92%、33.83%、45.3%、42%。
Aiming at the problems of low feasibility,correctness,alignment with requirements,and coverage of test cases generated by basic large models,an improvement method based on retrieval enhanced generation,prompt language engineering,and large model fine-tuning is proposed.Firstly,combining retrieval enhanced generation with large model language to supplement the generated results of the large model with external data;Secondly,establish an optimization system for prompt words,utilizing dynamic prompt adjustment and prompt language templating to make the output results more accurate;Finally,further fine tune the pre trained language model,but only adjust a small number of embedded words,rather than updating the model parameters on a large scale to reduce resource investment.The experiment shows that the proposed method improves feasibility,correctness,requirement alignment,and requirement coverage by 27.92%,33.83%,45.3%,and 42%,respectively,compared to the basic large model.
作者
严东荣
赵行前
顾钧
YAN Dongrong;ZHAO Xingqian;GU Jun(China Mobile(Suzhou)Software Technology Co.,Ltd.,Suzhou 215011,China)
出处
《软件导刊》
2025年第10期111-116,共6页
Software Guide
关键词
大模型
检索增强
提示语工程
大模型微调
测试用例生成
large model
retrieval-augmented generation
prompt engineering
fine-tuning large models
test case generation