Contribution-based Test Case Reduction Strategy for Mutation-based Fault Localization (S)

Haifeng Wang, Kun Yang, Xiangnan Zhao, Yuchen Cui, Weiwei WangSEKE 2023

Introduction

Presented at SEKE 2023, this research introduces Contribution-Based Test Case Reduction (CBTCR), a strategy designed to accelerate Mutation-Based Fault Localization (MBFL). MBFL is renowned for its precision in identifying software bugs but is often sidelined due to its prohibitive computational costs. CBTCR addresses this by slashing execution overhead by approximately 85% while maintaining high localization accuracy.

The Challenge of Mutation-Based Fault Localization

Fault Localization (FL) is critical for efficient debugging. While Spectrum-Based FL (SBFL) is computationally inexpensive, it often lacks precision. In contrast, MBFL offers superior accuracy by analyzing how "mutants" (small code modifications) interact with test suites. However, running an entire test suite against thousands of mutants is a "performance nightmare." Previous efforts primarily focused on reducing the number of mutants; CBTCR shifts the focus to optimizing the test suite itself.

The CBTCR Strategy

The core of CBTCR is the Contribution Value (cValue), a metric that identifies which passing test cases are most likely to provide useful information for the mutation phase. The process follows a structured pipeline:

  1. SBFL Pre-analysis: A rapid SBFL run (using the Dstar formula) assigns initial suspiciousness scores to all program statements.
  2. cValue Calculation: For each passing test case, a contribution value is calculated based on the sum of suspiciousness scores of the statements it covers. The intuition is that a passing test covering many "suspicious" lines is more valuable for narrowing down the fault.
  3. Test Suite Reduction: All failing tests are retained. Passing tests are ranked by their cValue, and only a top percentage (e.g., 10%) are selected for the next phase.
  4. MBFL Execution: Mutants are executed only against this high-value, reduced test suite.
  5. Final Ranking: Suspiciousness scores are recalculated based on mutant behavior under the reduced suite.
Overview of the CBTCR workflow, from initial program execution to final fault ranking.

Experimental Evaluation

The researchers evaluated CBTCR using the Defects4J (v2.0.0) benchmark, analyzing 383 real-world software faults across major Java projects such as JFreeChart, Commons Lang, and the Closure Compiler.

Key Results

CBTCR was compared against several baselines, including Random selection, FTMES (failed tests only), and IETCR (entropy-based).

  • Efficiency: CBTCR achieved an average execution cost reduction of 85.43%.
  • Effectiveness: At a 10% sampling ratio, CBTCR located 122 faults within the "Top-5" suspicious statements, outperforming Random (103), IETCR (93), and FTMES (120).
  • Statistical Significance: Wilcoxon signed-rank tests confirmed that CBTCR significantly outperforms other reduction strategies and remains competitive with the full-cost "Original" MBFL approach.
Comparison of fault localization accuracy (Top-N and MAP) across different reduction strategies and sampling ratios.

Conclusion and Future Work

The study identifies a 10% sampling ratio as a "sweet spot," providing an optimal balance between speed and precision. By using SBFL as a "scout" for the more intensive MBFL process, CBTCR makes high-precision fault localization viable for practical development cycles. Future research will focus on validating the strategy on industrial-scale systems and refining the theoretical weighting of the contribution value formula.

Summary updated

BibTeX
@inproceedings{wang2023contribution,
  author = {Haifeng Wang and Kun Yang and Xiangnan Zhao and Yuchen Cui and Weiwei Wang},
  title = {{Contribution-based Test Case Reduction Strategy for Mutation-based Fault Localization (S)}},
  booktitle = {SEKE},
  year = {2023},
  doi = {10.18293/seke2023-180},
}
Figure