Nexus:基于执行的多智能体测试Oracle综合
Nexus: Execution-Grounded Multi-Agent Test Oracle Synthesis
摘要:
非回归测试中的测试预言生成是软件工程中的一个长期挑战,其目标是生成能够准确地确定被测函数(FUT)是否按照给定输入的预期行为的预言。在本文中,我们介绍了Nexus,一种新的多智能体框架,以解决这一挑战。Nexus通过利用一组不同的专门代理来生成测试预言机,这些代理通过审议、验证和迭代自我改进的结构化过程来合成测试预言机。在审议阶段,一个由四个专家代理组成的小组,每个专家代理都体现了不同的测试哲学,他们合作地批评和改进了一组初始的测试预言。然后,在验证阶段,Nexus生成FUT的一个合理的候选实现,并在安全沙箱中执行所提出的预言。对于任何未能通过此基于执行的检查的oracle,Nexus激活自动自完善循环,使用特定的运行时错误在重新验证之前调试和纠正oracle。我们对七个不同基准的广泛评估表明,Nexus的性能始终大大优于最先进的基准。例如,Nexus将GPT-4.1-Mini在LiveCodeBench上的测试级Oracle准确率从46.30%提高到57.73%。准确性的提高也显著增强了下游任务:与基线相比,Nexus在HumanEval上GPT4.1-Mini生成的测试神谕的错误检测率从90.91%提高到95.45%,自动程序修复的成功率从35.23%提高到69.32%。
英文摘要:
Test oracle generation in non-regression testing is a longstanding challenge in software engineering, where the goal is to produce oracles that can accurately determine whether a function under test (FUT) behaves as intended for a given input. In this paper, we introduce Nexus, a novel multi-agent framework to address this challenge. Nexus generates test oracles by leveraging a diverse set of specialized agents that synthesize test oracles through a structured process of deliberation, validation, and iterative self-refinement. During the deliberation phase, a panel of four specialist agents, each embodying a distinct testing philosophy, collaboratively critiques and refines an initial set of test oracles. Then, in the validation phase, Nexus generates a plausible candidate implementation of the FUT and executes the proposed oracles against it in a secure sandbox. For any oracle that fails this execution-based check, Nexus activates an automated selfrefinement loop, using the specific runtime error to debug and correct the oracle before re-validation. Our extensive evaluation on seven diverse benchmarks demonstrates that Nexus consistently and substantially outperforms state-of-theart baselines. For instance, Nexus improves the test-level oracle accuracy on the LiveCodeBench from 46.30% to 57.73% for GPT-4.1-Mini. The improved accuracy also significantly enhances downstream tasks: the bug detection rate of GPT4.1-Mini generated test oracles on HumanEval increases from 90.91% to 95.45% for Nexus compared to baselines, and the success rate of automated program repair improves from 35.23% to 69.32%.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。