一句话:大规模评估大语言模型与提示策略在单元测试生成中的效果与局限。
单元测试是发现缺陷的关键手段,但因时间限制常被忽视;现有自动生成工具生成的测试可读性差,且需要开发者干预。以 GPT、Mistral 为代表的大语言模型在测试生成方面显示出潜力,但其有效性尚不明确。为此,本文开展大规模评估,系统研究大语言模型与提示(prompting)在单元测试生成中的表现。该工作通过大规模实验对比不同模型和提示策略对生成测试质量的影响,旨在为实践者选择方案和后续研究提供依据。具体结果需参阅原文。
Unit testing, essential for identifying bugs, is often neglected due to time constraints. Automated test generation tools exist but typically lack readability and require developer intervention. Large Language Models (LLMs) like GPT and Mistral show potential in test generation, but their effectiveness remains unclear.
@inproceedings{paperbot8329,
title = {LLMs and Prompting for Unit Test Generation: A Large-Scale Evaluation},
author = {Wendkuuni C. Ouedraogo and Kader Kabore and Haoye Tian and Yewei Song and Anil Koyuncu and Jacques Klein and David Lo and Tegawende F. Bissyande},
booktitle = {ASE},
year = {2024},
doi = {10.1145/3691620.3695330}
}