一致性与验证:在没有真实解决方案的情况下提升大型语言模型的测试生成质量
Consistency Meets Verification: Enhancing Test Generation Quality in Large Language Models Without Ground-Truth Solutions
AI总结:
ConVerTest通过自我一致性、验证链和双执行协议,在无需真实解决方案的情况下提升大型语言模型的测试生成质量。
摘要:
大型语言模型(LLMs)已显著推动了自动化测试生成的发展,但现有方法往往依赖真实代码进行验证,这会带来bug传播的风险,并限制了在测试驱动开发中的应用。我们提出了ConVerTest,一种新的两阶段流程,用于在无需先前代码实现的情况下合成可靠的测试。ConVerTest集成了三个核心策略:(i)自我一致性(SC)通过多数投票生成收敛的测试用例;(ii)验证链(CoVe)用于迭代、推理引导的代码细化;以及(iii)双执行协议,通过共识交叉验证代码和测试。在BIGCODEBENCH和LESS BASIC PYTHON PROBLEMS(LBPP)基准测试中,实验表明ConVerTest在测试有效性、行覆盖率和突变得分方面分别比基线提高了39%、28%和18%。我们的发现表明ConVerTest是缓解幻觉和增强自主软件测试代理可靠性的稳健解决方案。
英文摘要:
Large Language Models (LLMs) have significantly advanced automated test generation, yet existing methods often rely on ground-truth code for verification, risking bug propagation and limiting applicability in test-driven development. We present ConVerTest, a novel two-stage pipeline for synthesizing reliable tests without requiring prior code implementations. ConVerTest integrates three core strategies: (i) Self-Consistency(SC) to generate convergent test cases via majority voting; (ii) Chain-of-Verification (CoVe) for iterative, reasoning-guided code refinement; and (iii) a Dual Execution Agreement to crossvalidate code and tests through consensus. Experiments on BIGCODEBENCH and LESS BASIC PYTHON PROBLEMS (LBPP) benchmarks demonstrate that ConVerTest improves test validity, line coverage, and mutation scores by up to 39%, 28%, and 18% respectively over baselines. Our findings highlight ConVerTest as a robust solution for mitigating hallucinations and enhancing the reliability of autonomous software testing agents.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。