NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

WITNESS: A lightweight and practical approach to fine-grained predictive mutation testing

Zeyu Lu, Peng Zhang, Chun Yong Chong, Shan Gao, Yibiao Yang, Yanhui Li, Lin Chen, Yuming ZhouarXiv 2025 · DOI

Abstract

Mutation testing is a critical technique for assessing test suite quality, yet its computational cost remains a significant barrier to adoption. Predictive Mutation Testing (PMT) attempts to solve this by predicting test outcomes using machine learning. However, current fine-grained PMT models often rely on expensive deep learning architectures and ignore a substantial portion of mutants located outside method bodies. We propose WITNESS, a lightweight framework that leverages classical machine learning algorithms and expert-engineered features. WITNESS achieves state-of-the-art accuracy with speedups of up to 1,700x over deep learning baselines while supporting a wider range of mutation types.

Introduction: The Cost of Mutation Testing

Mutation testing evaluates test suites by intentionally injecting small faults (mutants) and checking if tests detect them. While effective, the process is computationally exhaustive, often taking hours or days for large projects. Fine-grained PMT aims to predict the result of every individual test-mutant pair. Unfortunately, existing tools suffer from exorbitant costs due to GPU requirements and a narrow scope that ignores "outside-method" code, such as field declarations or static initializers.

Distribution of mutant-test pairs across projects, highlighting the prevalence of outside-method mutants.

As shown in the data above, outside-method mutants can account for nearly 25% of all mutants in real-world projects, a segment entirely missed by previous state-of-the-art tools.

Methodology: The WITNESS Framework

WITNESS (light-WeIght Test effectiveNESs meaSurement) shifts the focus from model complexity to feature quality. The framework follows a multi-stage pipeline:

  1. Feature Collection: Extracts 21 key features across three categories: Source Code (complexity), Source Code Change (the "delta" between original and mutated code), and Test Case metrics (assertions and dynamic coverage).
  2. Classification Models: Uses an ensemble of Random Forest and LightGBM. These classical models are efficient on standard CPUs and offer better interpretability than deep learning "black boxes."
  3. Threshold Optimization: Employs a custom process combining F1-scores and Youden’s J statistic to handle the class imbalance inherent in mutation testing.
  4. SAPIENT: A downstream application that utilizes the predicted "kill matrix" to prioritize test cases.
The WITNESS framework architecture, from feature extraction to test case prioritization.

Evaluation and Results

The approach was evaluated using 31 versions of 6 large-scale projects from the Defects4J benchmark. The results demonstrate that WITNESS is not only more practical but also more effective than its predecessors.

  • Efficiency: WITNESS achieved massive speedups: 65.9x over Seshat, 986.1x over SODA, and 1,722.8x over MutationBERT. It runs in seconds on a standard laptop, whereas baselines required thousands of dollars in cloud computing resources.
  • Accuracy: Despite its lightweight nature, WITNESS consistently achieved higher F1-scores across same-version, cross-version, and cross-project scenarios.
  • Comprehensive Scope: By supporting outside-method mutants, WITNESS provides a more realistic evaluation of test suite health.

Discussion and Conclusion

The success of WITNESS highlights that the "delta" (the specific change made by a mutation) is the most influential factor in prediction. By prioritizing well-chosen features over model parameters, WITNESS makes fine-grained mutation testing practical for daily development. Future work will focus on automating feature selection and reducing the reliance on dynamic coverage data to further streamline the process.

Summary updated

BibTeX
@misc{lu2025witness,
  author = {Zeyu Lu and Peng Zhang and Chun Yong Chong and Shan Gao and Yibiao Yang and Yanhui Li and Lin Chen and Yuming Zhou},
  title = {{WITNESS: A lightweight and practical approach to fine-grained predictive mutation testing}},
  year = {2025},
  eprint = {2511.11999},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.11999},
}
Figure