Abstract
Traditional mutation testing often produces syntactically valid but semantically irrelevant mutants, limiting its effectiveness in security contexts. This paper introduces a framework for generating Vulnerability-mimicking Mutants (VMMs)—code mutants that behave like real-world security flaws. By combining µBERT, a language-model-driven mutant generator, with VMMS, a machine-learning-based selector, the authors provide a method to identify high-utility security mutants statically. Experimental results on the Vul4J dataset show that VMMs can mimic over 55% of real vulnerabilities, with the VMMS classifier achieving 80% precision in identifying them.
1. Introduction
Mutation testing evaluates test suite effectiveness by intentionally injecting faults. However, standard mutation operators often fail to capture the subtle, context-dependent errors typical of security vulnerabilities. Furthermore, the computational overhead of executing thousands of mutants is prohibitive. This research addresses these challenges by focusing on VMMs: mutants that exhibit the same observable failure behavior as known vulnerabilities, providing a more realistic benchmark for security testing.
2. Methodology
The research implements a two-stage pipeline for VMM identification, focusing on naturalness and static selection.
2.1 Generation with µBERT
Instead of simple syntactic swaps (e.g., changing + to -), µBERT uses the CodeBERT language model to predict replacements for masked tokens. This results in "natural" mutants that reflect common programming errors and logical mistakes human developers might actually make.
2.2 Selection with VMMS
To mitigate execution costs, the Vulnerability Mimicking Mutant Selector (VMMS) predicts VMMs statically. As illustrated in the pipeline below, the process involves abstracting code to generic identifiers (e.g., VAR_1), generating embeddings via an encoder-decoder architecture, and classifying these embeddings using a Random Forest model to predict mimicry potential.
3. Experimental Evaluation
The authors evaluated their approach using 45 reproducible Java vulnerabilities from the Vul4J dataset. A total of 16,409 mutants were generated from the fixed versions of these projects. A mutant was strictly defined as a VMM if it failed the exact same set of "Proof of Vulnerability" (PoV) tests as the original bug.
4. Key Results
The study found that VMMs are rare but highly impactful. Only 3.9% of generated mutants met the strict VMM criteria, yet this small set successfully mimicked 55.6% (25 out of 45) of the vulnerabilities. When broadening the criteria to mutants failing at least one common test, the coverage increased to 88.9%.
The VMMS classifier demonstrated strong performance, achieving a Matthews Correlation Coefficient (MCC) of 0.63 and a precision of 0.80. This indicates that the model can effectively prioritize mutants likely to be security-relevant without requiring full test execution, significantly reducing the computational burden of security-aware mutation testing.
5. Conclusion
Vulnerability-mimicking mutants provide a bridge between traditional mutation testing and real-world security analysis. By leveraging pre-trained language models and static classification, developers can generate and identify high-value mutants that simulate human-like security errors. Future work includes expanding the dataset across multiple languages and integrating these techniques into automated fuzzing pipelines to discover novel vulnerabilities.
Summary updated