paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Towards More Realistic Evaluation for Neural Test Oracle Generation

迈向更真实的神经测试预言生成评估
ISSTA Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis2023匹配度 4/10 · 该论文属于 ML-for-SE 中神经测试预言生成(NTOG)的评估方法研究,指出了现有评估设定的不合理(如用修复后版本生成前缀、指标不现实)并提出 TEval+ 与 Found@K,与你偏好的问题驱动式评估批评有一定共鸣;但它既非静态分析/形式化验证,也非 LLM/Agent 驱动的程序分析,更不涉及浮点或贝叶斯程序分析,与核心方向仅有边缘关联。引用 39 inbox
Zhongxin Liu, Kui Liu, Xin Xia, Xiaohu Yang
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:揭示神经测试预言生成评估的不合理设定,提出更真实评估方法 TEval+ 与 Found@K 指标。

单元测试的测试预言合成困难,现有研究用神经模型生成测试预言(NTOG),但其评估存在不合理设定。本文系统检查并量化三类问题:从已修复版本生成测试前缀、使用不现实的 FPR 指标、缺乏简单基线。结果显示,前者使先进方法 TOGA 发现的缺陷数虚高 61.8%;TOGA 的 Precision 仅 0.38%;简单 NoException 基线以两倍 Precision 找到 TOGA 所发现缺陷的 61%。作者引入排序步骤和 Found@K 指标,提出无监督排序方法,显著提升 TOGA 的成本效益,并给出更真实的评估方法 TEval+ 及七条实践规则。

问题
现有神经测试预言生成(NTOG)的评估设定不真实,例如从已修复版本生成测试前缀、采用不现实的 FPR 指标、缺少简单基线,可能误导对其缺陷发现能力的判断。
方法
系统量化这些设定的影响,并引入额外排序步骤与 Found@K 成本效益指标;提出无监督排序方法实例化该步骤,最终形成更真实的评估方法 TEval+ 和七条经验规则。
评估
以先进 NTOG 方法 TOGA 等为对象实验,报告缺陷数虚高 61.8%、Precision 仅 0.38%、NoException 基线以两倍 Precision 找到 61% 的缺陷,并验证无监督排序能提升成本效益。
原文摘要(Abstract)

Unit testing has become an essential practice during software development and maintenance. Effective unit tests can help guard and improve software quality but require a substantial amount of time and effort to write and maintain. A unit test consists of a test prefix and a test oracle. Synthesizing test oracles, especially functional oracles, is a well-known challenging problem. Recent studies proposed to leverage neural models to generate test oracles, i.e., neural test oracle generation (NTOG), and obtained promising results. However, after a systematic inspection, we find there are some inappropriate settings in existing evaluation methods for NTOG. These settings could mislead the understanding of existing NTOG approaches’ performance. We summarize them as 1) generating test prefixes from bug-fixed program versions, 2) evaluating with an unrealistic metric, and 3) lacking a straightforward baseline. In this paper, we first investigate the impacts of these settings on evaluating and understanding the performance of NTOG approaches. We find that 1) unrealistically generating test prefixes from bug-fixed program versions inflates the number of bugs found by the state-of-the-art NTOG approach TOGA by 61.8%, 2) FPR (False Positive Rate) is not a realistic evaluation metric and the Precision of TOGA is only 0.38%, and 3) a straightforward baseline NoException, which simply expects no exception should be raised, can find 61% of the bugs found by TOGA with twice the Precision. Furthermore, we introduce an additional ranking step to existing evaluation methods and propose an evaluation metric named Found@K to better measure the cost-effectiveness of NTOG approaches in terms of bug-finding. We propose a novel unsupervised ranking method to instantiate this ranking step, significantly improving the cost-effectiveness of TOGA. Eventually, based on our experimental results and observations, we propose a more realistic evaluation method TEval+ for NTOG and summarize seven rules of thumb to boost NTOG approaches into their practical usages.

链接与引用

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

BibTeX
@inproceedings{abs-2305-17047,
  title = {Towards More Realistic Evaluation for Neural Test Oracle Generation},
  author = {Zhongxin Liu and Kui Liu and Xin Xia and Xiaohu Yang},
  booktitle = {ISSTA},
  year = {2023},
  doi = {10.1145/3597926.3598080}
}