arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2402.09171cs.SE
收藏

在 Meta 使用大语言模型自动化改进单元测试

Automated Unit Test Improvement using Large Language Models at Meta

Nadia Alshahwan, Jubin Chheda, Anastasia Finegenova, Beliz Gokkaya, Mark Harman, Inna Harper, Alexandru Marginean, Shubho Sengupta, Eddy Wang

AI总结:

本文介绍了 Meta 的 TestGen-LLM 工具,利用 LLM 自动改进人工编写的测试,并通过过滤器确保可衡量的改进以消除幻觉问题,在 Instagram 和 Facebook 的实际部署中显著提升了测试覆盖率且建议采纳率高。

摘要:

本文描述了 Meta 的 TestGen-LLM 工具,该工具使用 LLM 自动改进现有的人工编写的测试。TestGen-LLM 验证其生成的测试类能够成功通过一组过滤器,这些过滤器确保相对于原始测试套件有可衡量的改进,从而消除了由于 LLM 幻觉导致的问题。我们描述了 TestGen-LLM 在 Meta 针对 Instagram 和 Facebook 平台的测试马拉松中的部署。在对 Instagram 的 Reels 和 Stories 产品的评估中,TestGen-LLM 的测试用例有 75% 构建正确,57% 可靠通过,25% 提高了覆盖率。在 Meta 的 Instagram 和 Facebook 测试马拉松期间,它改进了应用它的所有类中的 11.5%,其 73% 的建议被 Meta 软件工程师接受用于生产部署。我们相信这是关于由这种代码改进保证支持的 LLM 生成代码的工业规模部署的第一份报告。

英文摘要:

This paper describes Meta's TestGen-LLM tool, which uses LLMs to automatically improve existing human-written tests. TestGen-LLM verifies that its generated test classes successfully clear a set of filters that assure measurable improvement over the original test suite, thereby eliminating problems due to LLM hallucination. We describe the deployment of TestGen-LLM at Meta test-a-thons for the Instagram and Facebook platforms. In an evaluation on Reels and Stories products for Instagram, 75% of TestGen-LLM's test cases built correctly, 57% passed reliably, and 25% increased coverage. During Meta's Instagram and Facebook test-a-thons, it improved 11.5% of all classes to which it was applied, with 73% of its recommendations being accepted for production deployment by Meta software engineers. We believe this is the first report on industrial scale deployment of LLM-generated code backed by such assurances of code improvement.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑