arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.12862cs.SEcs.AIcs.LG
收藏

基于突变引导的LLM测试生成在Meta的应用

Mutation-Guided LLM-based Test Generation at Meta

Meta Platforms(元平台公司);FAIR, Meta Platforms(元平台公司FAIR实验室)

Christopher Foster, Abhishek Gulati, Mark Harman, Inna Harper, Ke Mao, Jillian Ritchey, Hervé Robert, Shubho Sengupta

AI总结:

Meta的ACH系统通过LLM生成针对特定问题的突变体及测试,强化代码防回归,应用于7个平台,生成9095个突变体和571个测试,工程师接受率达73%。

摘要:

本文描述了Meta的ACH系统,该系统用于基于突变引导的LLM测试生成。与传统突变测试相比,ACH生成相对较少的突变体(即模拟故障)。相反,它专注于生成当前未被检测到的、与特定关注问题相关的故障。从这些当前未被捕获的故障中,ACH生成能够捕获它们的测试,从而“杀死”突变体,并因此强化平台以防止回归。我们以隐私问题为例说明我们的方法,但ACH可以强化代码以抵御任何类型的回归。总体而言,ACH被应用于Meta部署的7个软件平台中的10,795个Android Kotlin类,从中生成了9,095个突变体和571个隐私强化测试用例。ACH还部署了一个基于LLM的等效突变检测代理,其精确率为0.79,召回率为0.47(通过简单预处理后分别提升至0.95和0.96)。ACH被Messenger和WhatsApp的测试马拉松使用,工程师接受了其73%的测试,并判断其中36%与隐私相关。我们得出结论,ACH强化了代码以应对特定关注问题,并且即使其测试不直接针对特定关注问题,工程师也因其其他益处而认为这些测试有用。

英文摘要:

This paper describes Meta's ACH system for mutation-guided LLM-based test generation. ACH generates relatively few mutants (aka simulated faults), compared to traditional mutation testing. Instead, it focuses on generating currently undetected faults that are specific to an issue of concern. From these currently uncaught faults, ACH generates tests that can catch them, thereby `killing' the mutants and consequently hardening the platform against regressions. We use privacy concerns to illustrate our approach, but ACH can harden code against {\em any} type of regression. In total, ACH was applied to 10,795 Android Kotlin classes in 7 software platforms deployed by Meta, from which it generated 9,095 mutants and 571 privacy-hardening test cases. ACH also deploys an LLM-based equivalent mutant detection agent that achieves a precision of 0.79 and a recall of 0.47 (rising to 0.95 and 0.96 with simple pre-processing). ACH was used by Messenger and WhatsApp test-a-thons where engineers accepted 73% of its tests, judging 36% to privacy relevant. We conclude that ACH hardens code against specific concerns and that, even when its tests do not directly tackle the specific concern, engineers find them useful for their other benefits.

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

↑