GRRLN: Gated Recurrent Residual Learning Networks for code clone detection
Authors:
- 7 February 2024
- journal article
- research article
- Published by Wiley in Journal of Software: Evolution and Process
- Vol. 36 (7)
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.Keywords
Funding Information
- National Natural Science Foundation of China (61872139)
This publication has 43 references indexed in Scilit:
- ROSF: Leveraging Information Retrieval and Supervised Learning for Recommending Code SnippetsIEEE Transactions on Services Computing, 2016
- Software Plagiarism Detection with Birthmarks Based on Dynamic Key Instruction SequencesIEEE Transactions on Software Engineering, 2015
- SPCP-Miner: A tool for mining code clones that are important for refactoring or tracking2015
- Towards a Big Data Curated Benchmark of Inter-project Code Clones2014
- Software clone detection: A systematic reviewInformation and Software Technology, 2013
- On the naturalness of software2012
- Comparison and evaluation of code clone detection techniques and tools: A qualitative approachScience of Computer Programming, 2009
- “Cloning considered harmful” considered harmful: patterns of cloning in softwareEmpirical Software Engineering, 2008
- Efficient token based clone detection with flexible tokenization2007
- CCFinder: a multilinguistic token-based code clone detection system for large scale source codeIEEE Transactions on Software Engineering, 2002