MARATTO

article

Advanced Cross-Language Clone Detection Using Modified AST and Graph Neural Network

Abstract

Cross-language code clone detection is a critical issue in software engineering, driven by the increasing use of multi-language systems within large-scale projects. Code clones-fragments of code with similar functionality but varied implementations-complicate software maintenance, elevating the risk of defects and increasing the cost of debugging and refactoring. Traditional Abstract Syntax Trees (ASTs) are widely used for clone detection but are often insufficient for cross-language scenarios due to their limitations in capturing comprehensive structural and semantic information. To overcome these limitations, this research introduces a modified AST, enhanced by the inclusion of Condition-Type Edges, which effectively model logical dependencies within control structures. This novel extension offers a deeper semantic understanding of the code's decision-making processes, addressing the shortcomings of conventional ASTs that focus solely on syntactic relationships. By integrating this modified AST with Graph Neural Networks (GNNs), our approach learns robust feature representations that capture semantic and structural variations across programming languages. Experimental evaluations on Java-Python code pairs show a notable improvement in detection accuracy, achieving a recall of 0.96, precision of 0.88, and an F1 score of 0.92, outperforming state-of-the-art techniques. These findings underscore the value of Condition-Type Edges in enhancing AST representations, providing a more reliable framework for cross-language code clone detection, and ultimately improving software quality and maintenance in multi-language environments.

Research topics

  • Network Security and Intrusion Detection

Read the original research

This page summarises published work. The authoritative version sits with the publisher.

DOI: 10.1109/icca62237.2024.10927826

Is something wrong with this record? Report it or request removal.

Discussion

Discuss this research

Have you built on this work, tried to replicate it, or seen it applied in practice? Share what you know. Verified researchers and MARATTO™ domain experts can open a discussion, and any member can reply. Contributions are reviewed before they appear.

No discussion yet. Open the first thread.