Modeling Functional Similarity in Source Code With Graph-Based Siamese Networks
- 18 August 2021
- journal article
- research article
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Software Engineering
- Vol. 48 (10) , 3771-3789
Abstract
Code clones are duplicate code fragments that share (nearly) similar syntax or semantics. Code clone detection plays an important role in software maintenance, code refactoring, and reuse. A substantial amount of research has been conducted in the past to detect clones. A majority of these approaches use lexical and syntactic information to detect clones. However, only a few of them target semantic clones. Recently, motivated by the success of deep learning models in other fields, including natural language processing and computer vision, researchers have attempted to adopt deep learning techniques to detect code clones. These approaches use lexical information (tokens) and(or) syntactic structures like abstract syntax trees (ASTs) to detect code clones. However, they do not make sufficient use of the available structural and semantic information, hence limiting their capabilities. This paper addresses the problem of semantic code clone detection using program dependency graphs and geometric neural networks, leveraging the structured syntactic and semantic information. We have developed a prototype tool HOLMES, based on our novel approach and empirically evaluated it on popular code clone benchmarks. Our results show that \tool performs considerably better than the other state-of-the-art tool, TBCCD. We also assessed HOLMES on unseen projects and performed cross dataset experiments to evaluate the generalizability of HOLMES. Our results affirm that HOLMES outperforms TBCCD since most of the pairs that HOLMES detected were either undetected or suboptimally reported by TBCCD.Keywords
All Related Versions
Funding Information
- Department of Science and Technology
- Confederation of Indian Industry
- IIIT Delhi
- Nucleus Software Exports Ltd
- National Research Foundation
- Industry Alignment Fund – Pre-positioning
This publication has 64 references indexed in Scilit:
- Multiobjective evolutionary algorithms to identify highly autocorrelated areas: the case of spatial distribution in financially compromised farmsAnnals of Operations Research, 2011
- An empirical study on the maintenance of source code clonesEmpirical Software Engineering, 2009
- CCFinder: a multilinguistic token-based code clone detection system for large scale source codeIEEE Transactions on Software Engineering, 2002
- Optimizing Java Bytecode Using the Soot Framework: Is It Feasible?2000
- Long Short-Term MemoryNeural Computation, 1997
- Data flow equations for explicitly parallel programsACM SIGPLAN Notices, 1993
- Neural Networks for Fingerprint RecognitionNeural Computation, 1993
- Efficiently computing static single assignment form and the control dependence graphACM Transactions on Programming Languages and Systems, 1991
- The program dependence graph and its use in optimizationACM Transactions on Programming Languages and Systems, 1987
- A program data flow analysis procedureCommunications of the ACM, 1976