Semantic Code Clone Detection Via Event Embedding Tree and GAT Network

Bingzhuo Li, Chunyang Ye, Shouyang Guan, Hui Zhou
{"title":"Semantic Code Clone Detection Via Event Embedding Tree and GAT Network","authors":"Bingzhuo Li, Chunyang Ye, Shouyang Guan, Hui Zhou","doi":"10.1109/QRS51102.2020.00057","DOIUrl":null,"url":null,"abstract":"Semantic code clone detection is an important yet challenging task in software engineering. Traditional methods rely on expert experience and cannot automatically determine which features are better for semantic code clone detection. Moreover, the program dynamics (e.g., the execution characteristics and execution order of statements) are not considered in these methods. As a result, this limits their ability to detect semantic clones. To address this issue, we propose a code clone detection method based on event embedding tree and Graph Attention Network. Our method uses a program control flow graph to capture the execution characteristics of each statement and extract the context relationship of different statements in the control flow. Based on such information, our method can calculate the functional similarity of two pieces of code, thereby identifying semantically similar code fragments. Experimental results show that our method is superior to state-of-the-art open source methods for Type-3 (syntactic) / Type-4 (semantic) clone detection.","PeriodicalId":301814,"journal":{"name":"2020 IEEE 20th International Conference on Software Quality, Reliability and Security (QRS)","volume":"80 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2020-12-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"5","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2020 IEEE 20th International Conference on Software Quality, Reliability and Security (QRS)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/QRS51102.2020.00057","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 5

Abstract

Semantic code clone detection is an important yet challenging task in software engineering. Traditional methods rely on expert experience and cannot automatically determine which features are better for semantic code clone detection. Moreover, the program dynamics (e.g., the execution characteristics and execution order of statements) are not considered in these methods. As a result, this limits their ability to detect semantic clones. To address this issue, we propose a code clone detection method based on event embedding tree and Graph Attention Network. Our method uses a program control flow graph to capture the execution characteristics of each statement and extract the context relationship of different statements in the control flow. Based on such information, our method can calculate the functional similarity of two pieces of code, thereby identifying semantically similar code fragments. Experimental results show that our method is superior to state-of-the-art open source methods for Type-3 (syntactic) / Type-4 (semantic) clone detection.
基于事件嵌入树和GAT网络的语义代码克隆检测
语义代码克隆检测是软件工程中一项重要而又具有挑战性的任务。传统的方法依赖于专家经验,不能自动确定哪些特征更适合语义代码克隆检测。此外,这些方法没有考虑程序的动态性(如语句的执行特征和执行顺序)。因此,这限制了它们检测语义克隆的能力。为了解决这一问题,我们提出了一种基于事件嵌入树和图注意网络的代码克隆检测方法。我们的方法使用程序控制流图来捕获每个语句的执行特征,并提取控制流中不同语句的上下文关系。基于这些信息,我们的方法可以计算两段代码的功能相似度,从而识别语义相似的代码片段。实验结果表明,我们的方法优于目前最先进的开源方法,用于类型3(语法)/类型4(语义)克隆检测。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约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学术文献互助群
群 号:604180095
Book学术官方微信