Existing fine-grained predictive mutation testing studies predominantly rely on deep learning, which faces two critical limitations in practice: (1) Exorbitant computational costs. The deep learning models adopted in these studies demand significant computational resources for training and inference acceleration. This introduces high costs and undermines the cost-reduction goal of predictive mutation testing. (2) Constrained applicability. Although modern mutation testing tools generate mutants both inside and outside methods, current fine-grained predictive mutation testing approaches handle only inside-method mutants. As a result, they cannot predict outside-method mutants, limiting their applicability in real-world scenarios. We propose WITNESS, a new fine-grained predictive mutation testing approach. WITNESS adopts a twofold design: (1) With collected features from both inside-method and outside-method mutants, WITNESS is suitable for all generated mutants. (2) Instead of using computationally expensive deep learning, WITNESS employs lightweight classical machine learning models for training and prediction. This makes it more cost-effective and enabling straightforward explanations of the decision-making processes behind the adopted models. Evaluations on Defects4J projects show that WITNESS consistently achieves state-of-the-art predictive performance across different scenarios. Additionally, WITNESS significantly enhances the efficiency of kill matrix prediction. Post-hoc analysis reveals that features incorporating information from before and after the mutation are the most important among those used in WITNESS. Test case prioritization based on the predicted kill matrix shows that WITNESS delivers results much closer to those obtained by using the actual kill matrix, outperforming baseline approaches.
翻译:现有的细粒度预测性变异测试研究主要依赖于深度学习,但在实践中面临两个关键限制:(1) 高昂的计算成本。这些研究中采用的深度学习模型在训练和推理加速时需要大量计算资源,这带来了高成本,并削弱了预测性变异测试旨在降低成本的初衷。(2) 受限的适用性。尽管现代变异测试工具会在方法内部和外部生成变异体,但当前的细粒度预测性变异测试方法仅能处理方法内部的变异体。因此,它们无法预测方法外部的变异体,限制了其在真实场景中的适用性。我们提出了WITNESS,一种新的细粒度预测性变异测试方法。WITNESS采用双重设计:(1) 通过收集方法内部和外部变异体的特征,WITNESS适用于所有生成的变异体。(2) 不使用计算昂贵的深度学习,WITNESS采用轻量级的经典机器学习模型进行训练和预测。这使得它更具成本效益,并能直接解释所采用模型背后的决策过程。在Defects4J项目上的评估表明,WITNESS在不同场景下始终达到最先进的预测性能。此外,WITNESS显著提高了杀死矩阵预测的效率。事后分析显示,在WITNESS使用的特征中,结合变异前后信息的特征最为重要。基于预测杀死矩阵的测试用例优先级排序表明,WITNESS提供的结果更接近使用实际杀死矩阵得到的结果,优于基线方法。