Hybrid deep learning-based classification of type-1 and type-2 code clones across multiple programming languages

dc.contributor.authorPrabodhani, H. K. G. S.
dc.contributor.authorVasanthapriyan, S.
dc.contributor.authorRubasinghe, T. D.
dc.date.accessioned2026-11-10T03:53:02Z
dc.date.available2026-11-10T03:53:02Z
dc.date.issued2026-08-20
dc.description.abstractCode clone detection is a crucial software engineering task that supports software maintenance, code reuse, and defect prevention by identifying duplicated or highly similar source code fragments. However, detecting Type-1 and Type-2 code clones across multiple programming languages remains challenging due to variations in syntax, lexical characteristics, and structural representations. Existing clone detection techniques often exhibit limited cross-language adaptability as they are primarily designed for individual programming languages or depend on a single form of code representation. This research proposes a hybrid deep learning framework that integrates lexical and structural code representations for effective Type-1 and Type-2 code clone classification across Java, Python, and C++ programming languages. A quantitative empirical evaluation approach is adopted using benchmark datasets, including BigCloneBench, CodeXGLUE, and CodeSearchNet. The source code samples undergo preprocessing steps, including tokenization, normalization, identifier abstraction, class balancing, and duplicate removal, to improve data consistency and minimize potential data leakage. The datasets are partitioned into training, validation, and testing subsets using a consistent 70:15:15 ratio to ensure fair and reliable model evaluation. The proposed Hybrid CNN-BiLSTM-Attention framework integrates lexical token sequences with Abstract Syntax Tree (AST)-based structural representations. CNN layers extract local syntactic patterns, BiLSTM networks capture contextual dependencies, the Attention mechanism emphasizes significant code regions, and AST features provide complementary structural information. The framework is evaluated against baseline deep learning models, including CNN, LSTM, and Transformer-based approaches, using accuracy, precision, recall, F1-score, ROC-AUC, confusion matrix, and cross-language evaluation metrics. The experimental results demonstrate that the proposed framework achieves 92% accuracy, outperforming the evaluated baseline models. Cross-language evaluation, performed by training on two programming languages and testing on an unseen third language, achieves accuracies of 83.2%, 84.5%, and 82.8% for C++, Java, and Python test scenarios, respectively. These results demonstrate strong multilingual generalization capability and confirm that combining lexical and AST-based structural representations improves Type-1 and Type-2 code clone detection performance. The proposed framework provides a scalable and effective solution for automated multilingual code clone classification. This research contributes a hybrid representation-based approach that enhances cross-language code analysis, reduces code duplication, and supports intelligent software engineering practices.
dc.identifier.citationProceedings of the Peradeniya University International Research Sessions (iPURSE) – 2026, University of Peradeniya, Sri Lanka, P 233
dc.identifier.isbn978-624-1234-56-7
dc.identifier.issn1391-4111
dc.identifier.urihttps://ir.lib.pdn.ac.lk/handle/20.500.14444/8270
dc.language.isoen
dc.publisherUniversity of Peradeniya, Sri Lanka
dc.subjectAbstract syntax tree
dc.subjectCode clone detection
dc.subjectCross-language code analysis
dc.subjectDeep learning
dc.subjectSoftware maintenance
dc.titleHybrid deep learning-based classification of type-1 and type-2 code clones across multiple programming languages
dc.typeAbstract

Files

Original bundle

Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
Prabodhani H. K. G. S. iPURSE 2026.pdf
Size:
271.94 KB
Format:
Adobe Portable Document Format

License bundle

Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
license.txt
Size:
1.71 KB
Format:
Item-specific license agreed to upon submission
Description:

Collections