Improving Cross-Language Code Clone Detection via Code Representation Learning and Graph Neural Networks
- 6 September 2023
- journal article
- research article
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Software Engineering
- Vol. 49 (11) , 4846-4868
Abstract
Code clone detection is an important aspect of software development and maintenance. The extensive research in this domain has helped reduce the complexity and increase the robustness of source code, thereby assisting bug detection tools. However, the majority of the clone detection literature is confined to a single language. With the increasing prevalence of cross-platform applications, functionality replication across multiple languages is common, resulting in code fragments having similar functionality but belonging to different languages. Since such clones are syntactically unrelated, single language clone detection tools are not applicable in their case. In this paper, we propose a semi-supervised deep learning-based tool RUBHUS, capable of detecting clones across different programming languages. RUBHUS uses the control and data flow enriched abstract syntax trees (ASTs) of code fragments to leverage their syntactic and structural information and then applies graph neural networks (GNNs) to extract this information for the task of clone detection. We demonstrate the effectiveness of our proposed system through experiments conducted over datasets consisting of Java, C, and Python programs and evaluate its performance in terms of precision, recall, and F1 score. Our results indicate that RUBHUS outperforms the state-of-the-art cross-language clone detection tools.Keywords
Funding Information
- Department of Science and Technology (DST)
- Anusandhan National Research Foundation
- Confederation of Indian Industry
- Infosys Center for Artificial Intelligence at IIIT-Delhi
- Nucleus Software Exports Ltd
This publication has 47 references indexed in Scilit:
- Detecting and characterizing semantic inconsistencies in ported code2013
- SSQSA architecture2012
- An empirical study on the maintenance of source code clonesEmpirical Software Engineering, 2009
- DECKARD: Scalable and Accurate Tree-Based Detection of Code Clones29th International Conference on Software Engineering (ICSE'07), 2007
- Software quality analysis by code clones in industrial legacy software2003
- Clone detection using abstract syntax trees2002
- Identifying similar code with program dependence graphs2002
- CCFinder: a multilinguistic token-based code clone detection system for large scale source codeIEEE Transactions on Software Engineering, 2002
- Dominance statistics: Ordinal analyses to answer ordinal questions.Psychological Bulletin, 1993
- SIGNATURE VERIFICATION USING A “SIAMESE” TIME DELAY NEURAL NETWORKInternational Journal of Pattern Recognition and Artificial Intelligence, 1993