一句话:提出 SODA 模型,用变异语义学习与对比采样捕捉变异体细微差异,提升预测性变异测试性能。
变异测试开销高,预测性变异测试(PMT)通过分类模型预测变异体是否被杀死。现有统计特征方法需昂贵动态特征且忽视代码文本;文本方法编码粗糙,难捕捉变异体细微差异及变异体-测试相关性。本文提出 SODA,采用变异语义学习,通过同变异体对比组采样强化变异体与测试的对应关系,并用对比学习捕捉细微代码变异及其对测试行为的影响。在跨项目和跨版本场景下,SODA 达到最优分类性能:kill-F1 提升 5.32%-114.92%,survive-F1 提升 0.04%-25.54%,准确率提升 4.25%-60.43%,且变异得分误差最低。
Mutation testing is widely used to measure the test adequacy of a project. Despite its popularity, mutation testing is time-consuming and extremely expensive. To mitigate this problem, researchers propose Predictive Mutation Testing (PMT). Existing PMT approaches build classification models based on statistical program features or source code of programs to predict mutation testing results. Previous statistical feature-based PMT models need expensive overhead to collect dynamic features and neglect the rich information inherent in code text. Previous text-based PMT models extract essential code elements as input and outperform the feature-based models. However, they encode code text in a plain way. Therefore, they cannot sensitively capture subtle differences in mutants and they have difficulty in capturing the correlation between mutants and tests. To address these challenges, we propose a new model, SODA. SODA uses a new learning strategy, Mutational Semantic Learning, to make our model spot code mutation and its impact on test behavior. In particular, we employ a new sampling strategy to reinforce the corresponding relationship between mutants and tests by sampling same-mutant contrastive groups. Then we employ contrastive learning to make our model capture subtle differences in mutants. We conduct experiments to investigate the performance of SODA. The results demonstrate that both in the cross-project and cross-version scenarios, SODA achieves state-of-the-art classification performance (improves upon baselines by 5.32%-114.92% in kill-F1 score, 0.04%-25.54% in survive-F1 score, 4.25%-60.43% in accuracy) and has the lowest mutation score error.
DOI 原文 ·
@inproceedings{paperbot8353,
title = {Spotting Code Mutation for Predictive Mutation Testing},
author = {Yifan Zhao and Yizhou Chen and Zeyu Sun and Qingyuan Liang and Guoqing Wang and Dan Hao},
booktitle = {ASE},
year = {2024},
doi = {10.1145/3691620.3695491}
}