Boosting Metamorphic Relation Prediction via Code Representation Learning: An Empirical Study

Xuedan Zheng, Mingyue Jiang, Zhi Quan Zhou
{"title":"Boosting Metamorphic Relation Prediction via Code Representation Learning: An Empirical Study","authors":"Xuedan Zheng, Mingyue Jiang, Zhi Quan Zhou","doi":"10.1002/stvr.1889","DOIUrl":null,"url":null,"abstract":"Metamorphic testing (MT) is an effective testing technique having a broad range of applications. One key task for MT is the identification of metamorphic relations (MRs), which is a fundamental mechanism in MT and is critical to the automation of MT. Prior studies have proposed approaches for predicting MRs (PMR). One major idea behind these PMR approaches is to represent program source code information via manually designed code features and then to apply machine‐learning–based classifiers to automatically predict whether a specific MR can be applied on the target program. Nevertheless, the human‐involved procedure of selecting and extracting code features is costly, and it may not be easy to obtain sufficiently comprehensive features for representing source code. To overcome this limitation, in this study, we explore and evaluate the effectiveness of code representation learning techniques for PMR. By applying neural code representation models for automatically mapping program source code to code vectors, the PMR procedure can be boosted with learned code representations. We develop 32 PMR instances by, respectively, combining 8 code representation models with 4 typical classification models and conduct an extensive empirical study to investigate the effectiveness of code representation learning techniques in the context of MR prediction. Our findings reveal that code representation learning can positively contribute to the prediction of MRs and provide insights into the practical usage of code representation models in the context of MR prediction. Our findings could help researchers and practitioners to gain a deeper understanding of the strength of code representation learning for PMR and, hence, pave the way for future research in deriving or extracting MRs from program source code.","PeriodicalId":501413,"journal":{"name":"Software Testing, Verification and Reliability","volume":"25 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-07-08","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Software Testing, Verification and Reliability","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1002/stvr.1889","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Metamorphic testing (MT) is an effective testing technique having a broad range of applications. One key task for MT is the identification of metamorphic relations (MRs), which is a fundamental mechanism in MT and is critical to the automation of MT. Prior studies have proposed approaches for predicting MRs (PMR). One major idea behind these PMR approaches is to represent program source code information via manually designed code features and then to apply machine‐learning–based classifiers to automatically predict whether a specific MR can be applied on the target program. Nevertheless, the human‐involved procedure of selecting and extracting code features is costly, and it may not be easy to obtain sufficiently comprehensive features for representing source code. To overcome this limitation, in this study, we explore and evaluate the effectiveness of code representation learning techniques for PMR. By applying neural code representation models for automatically mapping program source code to code vectors, the PMR procedure can be boosted with learned code representations. We develop 32 PMR instances by, respectively, combining 8 code representation models with 4 typical classification models and conduct an extensive empirical study to investigate the effectiveness of code representation learning techniques in the context of MR prediction. Our findings reveal that code representation learning can positively contribute to the prediction of MRs and provide insights into the practical usage of code representation models in the context of MR prediction. Our findings could help researchers and practitioners to gain a deeper understanding of the strength of code representation learning for PMR and, hence, pave the way for future research in deriving or extracting MRs from program source code.
通过代码表示学习提升变形关系预测:实证研究
变形测试(MT)是一种有效的测试技术,具有广泛的应用范围。MT 的一项关键任务是识别变态关系(MR),这是 MT 的基本机制,也是 MT 自动化的关键。之前的研究提出了预测变质关系(PMR)的方法。这些 PMR 方法背后的一个主要思路是通过人工设计的代码特征来表示程序源代码信息,然后应用基于机器学习的分类器来自动预测特定的 MR 是否可应用于目标程序。然而,人工选择和提取代码特征的过程成本高昂,而且要获得足够全面的源代码特征可能并不容易。为了克服这一局限性,在本研究中,我们探索并评估了用于 PMR 的代码表示学习技术的有效性。通过应用神经代码表示模型自动映射程序源代码到代码向量,可以用学习到的代码表示来增强 PMR 程序。我们通过将 8 个代码表示模型与 4 个典型分类模型相结合,开发了 32 个 PMR 实例,并进行了广泛的实证研究,以调查代码表示学习技术在磁共振预测中的有效性。我们的研究结果表明,代码表示学习可以为磁共振预测做出积极贡献,并为代码表示模型在磁共振预测中的实际应用提供了启示。我们的发现有助于研究人员和从业人员深入了解代码表示学习在 PMR 方面的优势,从而为今后从程序源代码中推导或提取 MR 的研究铺平道路。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信