TestPrism:超越单一参考的测试评估再思考
研究论文 · 2026/10/09
大语言模型(LLM)编码代理在多种编程任务的测试生成方面取得了进展。然而,针对单一参考解决方案评估测试的常见做法忽略了其他有效实现,并可能高估测试质量。我们提出了TestPrism,包含来自17个来源的300个测试任务和3000个候选实现,有效和无效解决方案各占一半。其主要指标联合成功函数要求生成的测试在初始程序状态上失败,接受所有有效候选,并拒绝所有无效候选。在14种基线编码代理配置中,联合成功函数仅达到28.00%,而单一参考成功率达到59.67%。我们的分析揭示了遗漏行为、不支持的断言和错误的测试构造。为了解决这些弱点,我们引入了TestHelix,它将测试和修复对的异构合成与同行交叉验证和递归自我改进(RSI)相结合。在两个模型上,TestHelix在TestHelix评估中比原生工具比较器将联合成功函数提高了8.67至9.00个百分点。
该研究挑战了测试评估中单一参考解决方案的常规做法,提出了更严格的评估基准和指标,并提供了改进方法,对提升LLM编码代理的测试生成质量具有重要意义。
Large language model (LLM) coding agents have advanced test generation across diverse programming tasks. However, the common practice of evaluating tests against a single reference solution overlooks alternative valid implementations and can overstate test quality. We introduce TestPrism, comprising 300 test tasks from 17 sources and 3000 candidate implementations, evenly split between valid and invalid solutions. Its primary metric, Joint Success Function, requires the generated tests to fail on the initial program state, accept every valid candidate, and reject every invalid candidate. Across fourteen baseline coding agent configurations, Joint Success Function reaches only 28.00%, whereas single reference success reaches 59.67%. Our analysis reveals missed behaviors, unsupported assertions, and faulty test construction. To address these weaknesses, we introduce TestHelix, which combines heterogeneous synthesis of test and repair pairs with peer cross validation and recursive self improvement (RSI). Across two models, TestHelix improves Joint Success Function by 8.67 to 9.00 percentage points over the native harness comparators in the TestHelix evaluation