Test suite effectiveness metric evaluation: what do we know and what should we do?

Peng Zhang, Yan Wang, Xutong Liu, Yibiao Yang, Yanhui Li, Lin Chen, Ziyuan Wang, Chang‐ai Sun, Yuming Zhou · DOI

Abstract

Comparing test suite effectiveness metrics has always been a research hotspot. However, prior studies have different conclusions or even contradict each other for comparing different test suite effectiveness metrics. The problem we found most troubling to our community is that researchers tend to oversimplify the description of the ground truth they use. For example, a common expression is that "we studied the correlation between real faults and the metric to evaluate (MTE)". However, the meaning of "real faults" is not clear-cut. As a result, there is a need to scrutinize the meaning of "real faults". Without this, it will be half-knowledgeable with the conclusions. To tackle this challenge, we propose a framework ASSENT (evAluating teSt Suite EffectiveNess meTrics) to guide the follow-up research. In nature, ASSENT consists of three fundamental components: ground truth, benchmark test suites, and agreement indicator. First, materialize the ground truth for determining the real order in effectiveness among test suites. Second, generate a set of benchmark test suites and derive their ground truth order in effectiveness. Third, for the benchmark test suites, generate the MTE order in effectiveness by the metric to evaluate (MTE). Finally, calculate the agreement indicator between the two orders. Under ASSENT, we are able to compare the accuracy of different test suite effectiveness metrics. We apply ASSENT to evaluate representative test suite effectiveness metrics, including mutation score metrics and code coverage metrics. Our results show that, based on the real faults, mutation score and subsuming mutation score are the best metrics to quantify test suite effectiveness. Meanwhile, by using mutants instead of real faults, MTEs will be overestimated by more than 20% in values.

The Problem of Ground Truth in Software Testing

In software engineering research, we rely on metrics like code coverage (e.g., Statement Coverage) or mutation scores to determine if a test suite is effective. However, the academic community currently faces a crisis of contradictory results. While some studies suggest mutation scores are the gold standard, others find only weak correlations with real-world fault detection.

The root cause of these discrepancies is the lack of a standardized "ground truth." Most researchers oversimplify what it means for one test suite to be objectively better than another. Without a rigorous definition of effectiveness, correlation analyses lead to conflicting conclusions and "half-knowledgeable" findings.

The ASSENT Framework

To address this, we introduce ASSENT (evAluating teSt Suite EffectiveNess meTrics), a framework designed to inject rigor into metric evaluation. ASSENT moves away from vague correlations and focuses on three core components:

  1. Materialized Ground Truth: ASSENT utilizes a strict subset rule. If Test Suite A contains all tests in Test Suite B plus the specific test cases that trigger a real-world fault, A is objectively more effective than B.
  2. Benchmark Generation: Using real-world bug databases, the framework generates pairs of test suites (the "whole" suite vs. the suite minus the bug-triggering tests).
  3. Order Preservation (OP): Instead of standard correlation, we use the OP indicator to measure how often a metric correctly identifies that Suite A is superior to Suite B.
The ASSENT framework components: materialized ground truth, benchmark generation, and agreement calculation.

Experimental Methodology

Our primary evaluation utilized Defects4J (v2.0.0), a benchmark containing hundreds of reproducible real-world faults from large Java projects such as JFreeChart and Closure Compiler. We compared seven metrics: Statement Coverage (SC), Branch Coverage (BC), and five variations of Mutation Scores, including Random and Subsuming mutation (SMS).

Key Findings

1. The Mutation Gold Standard

Our results confirm that Mutation Score (MS) and Subsuming Mutation Score (SMS) remain the most accurate predictors of a test suite's ability to find real bugs. These metrics achieved an average Order Preservation (OP) of 0.80, meaning they correctly ranked test suite effectiveness 80% of the time. In contrast, code coverage metrics (SC and BC) were significantly less accurate, often failing to distinguish between suites that caught a bug and those that did not.

2. The "Mutant Mirage"

Researchers often use simulated bugs (mutants) as a proxy for real faults because they are easier to generate. However, our study reveals a major threat to validity: using mutants as the ground truth causes researchers to overestimate metric accuracy by more than 20%. Metrics appear much stronger against simulated bugs than they do against real-world faults.

3. The Challenge of Invisible Faults

A significant finding was the existence of "invisible" faults. In our study, 49 out of 361 real faults were not captured by any of the tested metrics. This means that adding a test to catch these specific bugs did not improve the suite's coverage or mutation scores, highlighting a major gap in current metric sensitivity.

Venn diagrams illustrating the overlap of faults detected by different metrics and the presence of "invisible" faults (49 and 69) that no metric captured.

Conclusion and Future Work

While our ground truth definition is conservative—relying on subset relationships to ensure "safe" conclusions—it provides a necessary foundation for rigorous evaluation. We have demonstrated that mutation scores are currently our best tools, but they are not perfect. The presence of invisible faults suggests a critical need for the development of new, more sensitive metrics. We urge future researchers to adopt the ASSENT framework to validate the practical value of any newly proposed testing metrics.

Summary updated

Abstract

Comparing test suite effectiveness metrics has always been a research hotspot. However, prior studies have different conclusions or even contradict each other for comparing different test suite effectiveness metrics. The problem we found most troubling to our community is that researchers tend to oversimplify the description of the ground truth they use. For example, a common expression is that "we studied the correlation between real faults and the metric to evaluate (MTE)". However, the meaning of "real faults" is not clear-cut. As a result, there is a need to scrutinize the meaning of "real faults". Without this, it will be half-knowledgeable with the conclusions. To tackle this challenge, we propose a framework ASSENT (evAluating teSt Suite EffectiveNess meTrics) to guide the follow-up research. In nature, ASSENT consists of three fundamental components: ground truth, benchmark test suites, and agreement indicator. First, materialize the ground truth for determining the real order in effectiveness among test suites. Second, generate a set of benchmark test suites and derive their ground truth order in effectiveness. Third, for the benchmark test suites, generate the MTE order in effectiveness by the metric to evaluate (MTE). Finally, calculate the agreement indicator between the two orders. Under ASSENT, we are able to compare the accuracy of different test suite effectiveness metrics. We apply ASSENT to evaluate representative test suite effectiveness metrics, including mutation score metrics and code coverage metrics. Our results show that, based on the real faults, mutation score and subsuming mutation score are the best metrics to quantify test suite effectiveness. Meanwhile, by using mutants instead of real faults, MTEs will be overestimated by more than 20% in values.
BibTeX
@misc{zhang2022test,
  author = {Peng Zhang and Yan Wang and Xutong Liu and Yibiao Yang and Yanhui Li and Lin Chen and Ziyuan Wang and Chang‐ai Sun and Yuming Zhou},
  title = {{Test suite effectiveness metric evaluation: what do we know and what should we do?}},
  year = {2022},
  eprint = {2204.09165},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2204.09165},
}
Figure