一句话:提出主动学习驱动的预测式变异测试 AL-PMT,仅需少量变异体执行标签即可逼近最优预测性能。
变异测试能有效评估测试套件充分性,但全量执行变异体开销巨大。已有预测式变异测试(PMT)用静态特征、动态执行特征或代码与文档文本来预测变异体是否被杀死,然而基于特征的模型往往需要大量训练数据,甚至要对多个项目或版本做构建、运行与完整变异测试才能投用。本文提出基于主动学习的预测式变异测试 AL-PMT:主动挑选信息量最大的变异体加以执行与标注,迭代训练预测模型,从而大幅削减所需数据。实验表明,AL-PMT 在只观察每个项目约 10% 变异体杀死状态的情况下,在超过 80% 的项目中达到其最佳性能的 98%,性能优于或持平基础 PMT 基线。此外,AL-PMT 能识别困难变异体并优先执行,帮助开发者聚焦仍存活的变异体,降低人工核查成本,更契合工业应用场景。
Mutation testing is a powerful method of evaluating test suite adequacy. Despite growing industry attention, wide-scale application is frequently limited by the high runtime cost of mutation testing. A set of predictive models have been proposed to mitigate this cost issue, intending to replace the actual execution of a mutated program’s test suite with a predicted result of the tests’ outcome. These predictive models ingest static code features, dynamic execution features, or code and documentation text to produce the predictions. Feature-based models can require a large amount of training data and mutants executed by test cases to become operational. We propose active learning-based predictive mutation testing (AL-PMT) as a way to dramatically reduce the amount of training data needed for a performant model. We conduct experiments to compare AL-PMT’s performance with a non-active learning model and find that AL-PMT quickly converges to improved or on-par performance compared to the baseline of the foundational PMT. AL-PMT achieves 98% of its best possible performance in over 80% of examined projects, while observing only 10% of each project’s mutant set kill status. In addition to training in a fraction of the data required for previous models, AL-PMT is organized in a way that is more amenable to a potential industry application scenario. Besides not requiring the building, running and full mutation testing of several other projects or versions for training data, AL-PMT is able to identify challenging mutants and select them for execution. As such, we expand on the coverage metric provided by basic predictive mutation testing with the ability to guide the targeted execution of important mutants and guiding attention of developers to remaining survived ones. This addresses the rarely mentioned cost of human developer time on fixing the findings of mutation testing, rather than just the computational time spent producing the mutants.
DOI 原文 ·
@inproceedings{paperbot9217,
title = {Using Active Learning to Train Predictive Mutation Testing with Minimal Data},
author = {Miklós Borsi},
booktitle = {ASE},
year = {2025},
doi = {10.1109/ase63991.2025.00217}
}