一句话:提出状态字段覆盖率,静态度量测试预言对对象状态字段的检查比例,用以评估预言质量。
论文关注测试中预言(oracle)质量的评估问题:测试发现缺陷的能力不仅取决于输入与覆盖程度,也取决于判定程序行为是否符合预期的预言质量。现有度量要么难以为预言改进提供全面依据,要么仅针对特定类型的预言而缺乏通用性。作者提出「状态字段覆盖率」这一新度量,其直觉是:预言在测试执行中访问的对象状态字段(由类的字段静态定义)比例越高,越有可能检测出故障。论文实现了一个静态计算该度量的机制,因而开销低,并能通过指出未被检查的状态字段直接指导预言改进。作者在 273 个表示不变式与 249,027 条测试断言上进行了实验评估,结果表明该度量与预言检测故障的能力(以变异得分衡量)强相关,适合用于评估预言质量。
The effectiveness of testing in uncovering software defects depends not only on the characteristics of the test inputs and how thoroughly they exercise the software, but also on the quality of the oracles used to determine whether the software behaves as expected. Therefore, assessing the quality of oracles is crucial to improve the overall effectiveness of the testing process. Existing metrics have been used for this purpose, but they either fail to provide a comprehensive basis for guiding oracle improvement, or they are tailored to specific types of oracles, thus limiting their generality.In this paper, we introduce state field coverage, a novel metric for assessing oracle quality. This metric measures the proportion of an object’s state, as statically defined by its class fields, that an oracle may access during test execution. The main intuition of our metric is that oracles with a higher state field coverage are more likely to detect faults in the software under analysis, as they inspect a larger portion of the object states to determine whether tests pass or not.We implement a mechanism to statically compute the state field coverage metric. Being statically computed, the metric is efficient and provides direct guidance for improving test oracles by identifying state fields that remain unexamined. We evaluate state field coverage through experiments involving 273 representation invariants and 249,027 test assertions. The results show that state field coverage is a well-suited metric for assessing oracle quality, as it strongly correlates with the oracles’ fault-detection ability, measured by mutation score.
DOI 原文 ·
@inproceedings{paperbot9264,
title = {State Field Coverage: A Metric for Oracle Quality},
author = {Facundo Molina and Nazareno Aguirre and Alessandra Gorla},
booktitle = {ASE},
year = {2025},
doi = {10.1109/ase63991.2025.00222}
}