论文标题

使用源代码指标来预测方法级别的变质关系

Using Source Code Metrics for Predicting Metamorphic Relations at Method Level

论文作者

Duque-Torres, Alejandra, Pfahl, Dietmar, Klammer, Claus, Fischer, Stefan

论文摘要

变质测试(TM)检查了测试运行的输入和输出之间的关系。这些关系称为变质关系(MR)。当前,MRS是精心挑选的,需要对正在测试的系统(SUT)及其问题域进行深入了解。结果,高质量MRS的识别和选择是一个挑战。 \ citeauthor {pmr1}建议自动预测从预定义列表中选择的适用MRS的预测变质关系(PMR)方法。 PMR基于支持向量机(SVM)模型,使用从100个Java方法的控制流程图(CFG)得出的功能。 \ citeauthor {pmr1}的原始研究表现出令人鼓舞的结果,但是与CFG相关特征开发分类模型的成本很高。在本文中,我们旨在开发一种PMR方法,该方法的成本较低而不会失去性能。我们通过考虑与CFG相关功能以外的其他方法来补充原始PMR方法。我们定义了21个可以从源代码中直接提取并构建包括SVM型号在内的分类器的功能。我们的结果表明,使用原始的基于CFG的方法级特征,尤其是对于带有随机行走内核(RWK)的SVM,就大多数候选MRS而言,AUC-ROC的AUC-ROC获得了更好的预测。但是,对于候选MRS之一,使用源代码功能获得了最佳的AUC-ROC结果(大于0.8)。

Metamorphic testing (TM) examines the relations between inputs and outputs of test runs. These relations are known as metamorphic relations (MR). Currently, MRs are handpicked and require in-depth knowledge of the System Under Test (SUT), as well as its problem domain. As a result, the identification and selection of high-quality MRs is a challenge. \citeauthor{PMR1} suggested the Predicting Metamorphic Relations (PMR) approach for automatic prediction of applicable MRs picked from a predefined list. PMR is based on a Support Vector Machine (SVM) model using features derived from the Control Flow Graphs (CFGs) of 100 Java methods. The original study of \citeauthor{PMR1} showed encouraging results, but developing classification models from CFG-related features is costly. In this paper, we aim at developing a PMR approach that is less costly without losing performance. We complement the original PMR approach by considering other than CFG-related features. We define 21 features that can be directly extracted from source code and build several classifiers, including SVM models. Our results indicate that using the original CFG-based method-level features, in particular for a SVM with random walk kernel (RWK), achieve better predictions in terms of AUC-ROC for most of the candidate MRs than our models. However, for one of the candidate MRs, using source code features achieved the best AUC-ROC result (greater than 0.8).

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源