Meta 使用大型语言模型实现自动化单元测试改进
软件工程
2024-02-15 v1
摘要
本文描述了 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 生成代码并附有此类代码改进保证的报告。
引用
@article{arxiv.2402.09171,
title = {Automated Unit Test Improvement using Large Language Models at Meta},
author = {Nadia Alshahwan and Jubin Chheda and Anastasia Finegenova and Beliz Gokkaya and Mark Harman and Inna Harper and Alexandru Marginean and Shubho Sengupta and Eddy Wang},
journal= {arXiv preprint arXiv:2402.09171},
year = {2024}
}
备注
12 pages, 8 figures, 32nd ACM Symposium on the Foundations of Software Engineering (FSE 24)