paperbot · PL 论文追踪

全部论文 待读 收藏

P1 LLM-based Specification-Driven Test Oracle Enhancement

基于LLM的规约驱动测试预言增强
FSE Proceedings of the 34th ACM International Conference on the Foundations of Software Engineering2026匹配度 5/10 · 论文用 LLM 分析规约来增强测试预言并发现 OpenJDK 真实缺陷,属于 LLM/Agent 辅助程序分析与测试的相邻方向,但核心是动态测试而非用户重点关注的静态分析或形式化验证,也不涉及浮点程序分析或贝叶斯程序分析。引用 0 inbox
Ruifeng Fu, Yingquan Zhao, Meng Wang, Zan Wang, Junjie Chen
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:用大语言模型分析规约自动增强测试预言,在 OpenJDK 中发现 45 个已被确认或修复的未知缺陷。

现有测试预言往往不完整,难以检测实现偏离规约的缺陷,而既有技术依赖粗粒度失败信号或大量人工投入。本文提出规约驱动的 JavaOracle,用 LLM 系统化增强测试预言:先分析规约推导测试未覆盖的预言,并以根因引导的修复流程保证用例有效;再以多智能体辩论区分真实规约违背与 LLM 幻觉导致的断言失败;最后自动最小化用例并生成缺陷报告。在 OpenJDK Java SE API 的 3961 个用例上,JavaOracle 优于 Fuzz4All、ChatAssert 与 Randoop,累计发现 45 个已被确认或修复的未知缺陷;流水线平均每次运行仅 6 份报告,精度 88.9%,增强用例执行通过率 79.1%。

问题
现有测试预言不完整,且预言构建技术依赖粗粒度失败信号或大量人工投入,难以检测实现违背规约的缺陷。
方法
提出 JavaOracle,分三阶段:用 LLM 分析规约推导新预言并经根因引导修复保证有效性;用多智能体辩论区分真实规约违背与 LLM 幻觉导致的断言失败;自动完成用例最小化与缺陷报告生成。
评估
在 OpenJDK Java SE API 的 3961 个测试用例上与 Fuzz4All、ChatAssert、Randoop 对比,并进行消融实验;累计发现 45 个已被开发者确认/修复的未知缺陷,流水线精度 88.9%。
原文摘要(Abstract)

Software testing critically depends on test oracles, yet existing test oracles are often incomplete and insufficient for detecting bugs where implementations deviate from their specifications. Meanwhile, despite advances in test oracle construction, existing techniques typically rely on coarse-grained failure signals or require substantial manual effort, and thus remain inadequate for detecting specification-violation bugs. To address these limitations, we propose JavaOracle, a specification-driven approach that leverages large language models (LLMs) to reason over specifications and systematically enhance test oracles. Specifically, JavaOracle consists of three stages. First, it leverages LLMs to analyze specifications and derive additional test oracles that are not covered by existing tests, while integrating a root-cause-guided repair workflow to ensure that the enhanced test cases are syntactically and semantically valid. Second, it designs a multi-agent debate workflow to distinguish previously unknown specification-violation bugs from assertion failures caused by LLM hallucinations, thereby mitigating the impact of hallucinations. Third, unlike existing approaches that stop at bug detection, JavaOracle further automates test case minimization and bug report generation, producing submission-ready reports without manual effort. We evaluate JavaOracle on 3,961 test cases for Java SE API from the OpenJDK. Experimental results on the latest OpenJDK standard library show that JavaOracle substantially outperforms state-of-the-art baselines, including Fuzz4All, ChatAssert, and Randoop. Cumulatively, JavaOracle discovers 45 previously unknown bugs, which have already been confirmed/fixed by developers, with many persisting since their initial implementation. In an entire pipeline running, JavaOracle reduces execution failures to an average of 6 reports per run, achieving 88.9% precision. In contrast, baseline approaches required exhaustive manual inspection to identify only 0, 3, and 2 real bugs, respectively. Further analysis shows that test cases enhanced by JavaOracle achieve high validity, with an execution pass rate of 79.1%, compared to 35.4%, 92.2% (55.5% test cases unchanged), and 77.6% for the baselines. Ablation studies further demonstrate the effectiveness of JavaOracle components, while the automated pipeline significantly reduces manual analysis effort.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@inproceedings{FuZWWC26,
  title = {LLM-based Specification-Driven Test Oracle Enhancement},
  author = {Ruifeng Fu and Yingquan Zhao and Meng Wang and Zan Wang and Junjie Chen},
  booktitle = {FSE},
  year = {2026},
  doi = {10.1145/3803437.3805616}
}