首页|AIGC辅助软件单元测试的研究

AIGC辅助软件单元测试的研究

扫码查看
介绍了一种基于AIGC的单元测试方法—CodeQwenTest,旨在提高软件测试的效率与质量.通过从开源平台Github收集的高质量的Java焦点方法及其相应的单元测试,构建了一个精心设计的焦点数据集.利用这一数据集,对6种领先的大型语言模型(LLMs)进行了深入的单元测试生成和代码生成任务实验.在这些实验的基础上,选择了 CodeQwen1.5-7B-Chat模型,并对其进行了 LoRA微调,以进一步提升其在单元测试代码生成任务中的表现.实验结果显示,经过微调的CodeQwenTest在行覆盖率方面显著优于基线模型,并且能够高效地生成断言.这一发现证实了 AIGC技术在辅助软件单元测试中的有效性,为软件测试领域带来了新的工具和方法,为软件测试的自动化提供了新的视角.
Research on Software Unit Testing Based on AIGC
In this paper,an AIGC based unit testing method,CodeQwenTest,is introduced with the aim of improving the effi-ciency and quality of software testing.A well-designed focus dataset was constructed by collecting high-quality Java focus meth-ods and their corresponding unit tests from the open-source platform GitHub.Using this dataset,we conducted in-depth exper-iments on unit test generation and code generation tasks for six leading Large Language Models(LLMs).Based on these exper-iments,we selected the CodeQwen1.5-7B-Chat model and fine-tuned it with LoRA to further enhance its performance in unit test code generation tasks.Experimental results show that the fine-tuned CodeQwenTest significantly outperforms the baseline model in terms of line coverage and generates assertions efficiently.This finding confirms the effectiveness of the AIGC tech-nique in assisting software unit testing,bringing new tools and methods to the software testing field and providing new per-spectives on the automation of software testing.

artificial intelligence generated contentsoftware unit testingautomated test case generationlarge language mod-elssoftware engineering

杨浠、熊盼、郑旭飞、吴海林、郭伟

展开 >

西南大学计算机与信息科学学院/软件学院,重庆 400715

重庆信安网络安全等级测评有限公司,重庆 401121

人工智能生成内容 软件单元测试 自动化测试用例生成 大语言模型 软件工程

2024

西南师范大学学报(自然科学版)
西南大学

西南师范大学学报(自然科学版)

CSTPCD北大核心
影响因子:0.805
ISSN:1000-5471
年,卷(期):2024.(4)