GRRLN: Gated Recurrent Residual Learning Networks for code clone detection

IF 2 4区 计算机科学 Q2 Computer Science
Xiangping Zhang, Jianxun Liu, Min Shi
{"title":"GRRLN: Gated Recurrent Residual Learning Networks for code clone detection","authors":"Xiangping Zhang, Jianxun Liu, Min Shi","doi":"10.1002/smr.2649","DOIUrl":null,"url":null,"abstract":"Code clone detection is a critical problem in software development and maintenance domains. It aims to identify functionally identical or similar code fragments within an application. Existing works formulate the code clone detection task as a binary classification problem which predicts a code pair as a clone or not based on a pre‐defined threshold. In reality, there are various types of code clone subject to the degree of how a pair of code fragments are similar to each other. To investigate the effect of different code clone detection manners on the clone detection result, we propose Gated Recurrent Residual Learning Networks (GRRLN), a novel neural network model for code clone detection. To train GRRLN, we first represent each code fragment as a statement‐level tree sequence derived from the whole abstract syntax tree (AST). Then, a gated recurrent neural network with residual connections is adopted to fully extract the semantics of all individual statement trees together with their dependency relationships across the input statement sequence. Finally, the output representations of code fragments by GRRLN are used for similarity calculation and clone detection. We evaluate GRRLN using two real‐world datasets for code clone detection and clone type classification. Experiments show that GRRLN achieves promising and compelling results and meanwhile needs significantly less time and memory consumption compared with the state‐of‐the‐art methods.","PeriodicalId":49024,"journal":{"name":"Journal of Software: Evolution and Process","volume":"57 10","pages":""},"PeriodicalIF":2.0000,"publicationDate":"2024-02-07","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Software: Evolution and Process","FirstCategoryId":"94","ListUrlMain":"https://doi.org/10.1002/smr.2649","RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q2","JCRName":"Computer Science","Score":null,"Total":0}
引用次数: 0

Abstract

Code clone detection is a critical problem in software development and maintenance domains. It aims to identify functionally identical or similar code fragments within an application. Existing works formulate the code clone detection task as a binary classification problem which predicts a code pair as a clone or not based on a pre‐defined threshold. In reality, there are various types of code clone subject to the degree of how a pair of code fragments are similar to each other. To investigate the effect of different code clone detection manners on the clone detection result, we propose Gated Recurrent Residual Learning Networks (GRRLN), a novel neural network model for code clone detection. To train GRRLN, we first represent each code fragment as a statement‐level tree sequence derived from the whole abstract syntax tree (AST). Then, a gated recurrent neural network with residual connections is adopted to fully extract the semantics of all individual statement trees together with their dependency relationships across the input statement sequence. Finally, the output representations of code fragments by GRRLN are used for similarity calculation and clone detection. We evaluate GRRLN using two real‐world datasets for code clone detection and clone type classification. Experiments show that GRRLN achieves promising and compelling results and meanwhile needs significantly less time and memory consumption compared with the state‐of‐the‐art methods.
GRRLN:用于代码克隆检测的门控递归残差学习网络
代码克隆检测是软件开发和维护领域的一个关键问题。它旨在识别应用程序中功能相同或相似的代码片段。现有作品将代码克隆检测任务表述为一个二元分类问题,即根据预先定义的阈值预测代码对是否为克隆。实际上,根据代码片段对彼此相似的程度,克隆代码有多种类型。为了研究不同代码克隆检测方式对克隆检测结果的影响,我们提出了用于代码克隆检测的新型神经网络模型--门控递归残差学习网络(GRRLN)。为了训练 GRRLN,我们首先将每个代码片段表示为从整个抽象语法树(AST)中导出的语句级树序列。然后,采用具有残差连接的门控递归神经网络,全面提取输入语句序列中所有单个语句树的语义及其依赖关系。最后,GRRLN 输出的代码片段表示被用于相似性计算和克隆检测。我们使用两个真实世界的数据集对 GRRLN 进行了代码克隆检测和克隆类型分类评估。实验表明,GRRLN 取得了令人满意的结果,同时与最先进的方法相比,大大减少了所需的时间和内存消耗。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
Journal of Software: Evolution and Process
Journal of Software: Evolution and Process Computer Science-Software
CiteScore
5.30
自引率
10.00%
发文量
0
审稿时长
6-12 weeks
期刊介绍: The “Journal of Software: Evolution and Process” is an archival journal that publishes high quality, state-of-the-art research and practice papers dealing with the conception, development, testing, management, quality, maintenance, and evolution of software, systems, and services, as well as the continuous improvement of processes and capabilities surrounding them. The journal continues the tradition of “The Journal of Software Maintenance and Evolution: Research and Practice” and “Software Process: Improvements and Practice”. We will therefore continue to cover the traditional topics related to software maintenance and evolution as well as software process improvement and practice. At the same time, the concept behind the journal has evolved into a unified vision that recognizes the fundamental changes and transformations that are occurring in the fields of software and systems engineering and the need for us to adapt by broadening the topics that we address and the research methods that are used coupled with the perspectives that are utilised. Fundamental changes are occurring in the variety, scale and scope of software, systems and services that are being developed from new web and mobile computing to battle theatre technologies and everything in between.
×
引用
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学术官方微信