arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2205.15835cs.SE
收藏

基于Source Code的方法级变形关系预测

Using Source Code Metrics for Predicting Metamorphic Relations at Method Level

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

摘要:

变形测试(TM)检查测试运行的输入和输出之间的关系。这些关系被称为变形关系(MR)。目前,MR是精心挑选的,需要深入了解被测系统(SUT)及其问题域。因此,识别和选择高质量的MR是一项挑战。\citeauthor{PMR1}建议使用预测变形关系(PMR)方法自动预测从预定义列表中挑选的适用MR。PMR基于支持向量机(SVM)模型,该模型使用从100种Java方法的控制流图(CFG)中导出的特征。\citeauthor{PMR1}的最初研究显示了令人鼓舞的结果,但从CFG相关特征开发分类模型的成本很高。在本文中,我们的目标是开发一个PMR的方法,是成本较低,而不会失去性能。我们补充了原来的PMR的方法,考虑以外的CFG相关功能。我们定义了21个可以直接从源代码中提取的特征,并构建了几个分类器,包括SVM模型。我们的研究结果表明,使用原始的基于CFG的方法级特征,特别是具有随机游走核(RWK)的SVM,对于大多数候选MR,在AUC-ROC方面实现了比我们的模型更好的预测。然而,对于其中一个候选MR,使用源代码功能实现了最佳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).

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑