Latent Mutants: A large-scale study on the Interplay between mutation testing and software evolution

Jeongju Sohn, Ezekiel O. Soremekun, Michail PapadakisarXiv 2025 · DOI

Abstract

Mutation testing is a robust technique for evaluating test suite effectiveness, yet it suffers from a high volume of "live" mutants that may be redundant or irrelevant. This study introduces the concept of latent mutants—mutants that survive current test suites but are eventually caught by tests added later in a project's evolution. By tracking over 130,000 mutants across 13 open-source Java projects, we demonstrate that these mutants represent genuine testing gaps. Our findings show that latent mutants can be predicted with 86% accuracy, primarily using historical code features like code age, offering a path to more efficient mutation testing.

Introduction: The Noise Problem in Mutation Testing

Mutation testing measures test suite quality by intentionally injecting small bugs (mutants) into code. If a test suite fails to catch a mutant, it is considered "live," signaling a potential gap in testing. However, the technique generates a massive amount of "noise." Many live mutants are equivalent to the original code or are simply irrelevant, overwhelming developers who must decide which ones warrant new tests.

This research shifts the focus from a static snapshot to a longitudinal "in-time" analysis. The authors argue that the most valuable mutants are "latent mutants": those that developers eventually recognize as important enough to write tests for in the future.

Methodology: Tracking Mutants Over Time

To identify these mutants, the researchers performed a large-scale longitudinal study. They tracked mutants across multiple releases and commits using AST (Abstract Syntax Tree) mapping via the GumTree tool. This allowed them to monitor a mutant's location as the source code evolved.

Classification of mutant states over a project's timeline.

Mutants were tracked for up to 365 days and classified into five distinct states:

  • Killed: Caught by the current test suite.
  • Live: Not caught by the current suite.
  • Latent: Live initially, but killed by a future test suite.
  • Non-Latent: Live and never killed within the observation window.
  • Discarded: The mutated code was deleted or overwritten before a test could catch it.

Experimental Dataset

The study utilized the Defects4J dataset, focusing on 13 prominent open-source Java projects. In total, the authors analyzed 131,308 mutants generated by the Pitest tool.

Overview of the 13 open-source projects analyzed in the study.

Key Findings and Predictability

The study revealed several critical insights into the nature of software testing and evolution:

  1. Mutants as Dormant Bugs: Latent mutants exist in the codebase for an average of 104 days (or 136 revisions) before being caught. This mirrors the behavior of real-world latent bugs.
  2. The Useful Minority: While 11% of mutants are live, only 3.5% are latent. These represent the "goldilocks" mutants—meaningful gaps that are eventually addressed.
  3. Predictive Power: Using a Random Forest classifier, the authors identified latent mutants with 86% accuracy. The most significant predictor was code age; mutants in newer code are far more likely to be latent than those in legacy code.
  4. Indirect Revelation: Over 90% of latent mutants are revealed by changes in dependent code or new tests, rather than changes to the mutated line itself, suggesting that system growth eventually exposes these dormant faults.

Conclusion

By focusing on predicted latent mutants, developers can significantly reduce the overhead of mutation testing while targeting the most productive gaps in their suites. Future work involves integrating these prediction models into IDEs to provide real-time alerts for high-value mutants, streamlining the path toward more robust software.

Summary updated

BibTeX
@misc{sohn2025latent,
  author = {Jeongju Sohn and Ezekiel O. Soremekun and Michail Papadakis},
  title = {{Latent Mutants: A large-scale study on the Interplay between mutation testing and software evolution}},
  year = {2025},
  eprint = {2501.01873},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2501.01873},
}
Figure