Applying Tree-Based Convolutional Neural Networks to classify design patterns

Kusper, Gábor, Hidi, Erik Zoltán, Kusper, Krisztián, Yang, Zijian Győző, Márien, Szabolcs (2025) Applying Tree-Based Convolutional Neural Networks to classify design patterns In: Proceedings of the International Conference on Formal Methods and Foundations of Artificial Intelligence. Eger, Eszterházy Károly Catholic University. pp. 140-147.

[thumbnail of fmfai2025_pp140-147.pdf] pdf
fmfai2025_pp140-147.pdf

Download (629kB) [error in script]
Hivatalos webcím (URL): https://doi.org/10.17048/fmfai.2025.140

Absztrakt (kivonat)

Automatic detection and classification of design patterns are an increasingly relevant task in modern software engineering, as it directly contributes to improving code quality, readability, and maintainability. In this paper, we propose the application of a modified Tree-Based Convolutional Neural Network (TBCNN) architecture for the recognition of GoF design patterns in Java source code. The approach leverages Abstract Syntax Trees (ASTs) as structural representations of programs, where nodes are encoded by a pre-trained embedding model that captures semantic similarities between language keywords. The resulting vectorized ASTs are processed by the TBCNN, enabling the model to learn both structural and semantic features characteristic of design patterns. For training and evaluation, we collected a dataset of Java implementations of design patterns from GitHub repositories, resulting in approximately 500–600 samples per pattern. Experimental results demonstrate high classification accuracy, with average precision, recall, and F1-scores exceeding 98% across eight design patterns. These findings confirm the viability of tree-based deep learning methods for pattern recognition in source code. However, the model shows limitations when applied to real-world production code, likely due to the restricted representativeness of the training data, which consists mainly of educational implementations.

Mű típusa: Könyvrészlet - Book section
Szerző:
Szerző neve
Email
MTMT azonosító
ORCID azonosító
Közreműködés
Kusper, Gábor
NEM RÉSZLETEZETT
NEM RÉSZLETEZETT
NEM RÉSZLETEZETT
Szerző
Hidi, Erik Zoltán
NEM RÉSZLETEZETT
NEM RÉSZLETEZETT
NEM RÉSZLETEZETT
Szerző
Kusper, Krisztián
NEM RÉSZLETEZETT
NEM RÉSZLETEZETT
NEM RÉSZLETEZETT
Szerző
Yang, Zijian Győző
NEM RÉSZLETEZETT
NEM RÉSZLETEZETT
NEM RÉSZLETEZETT
Szerző
Márien, Szabolcs
NEM RÉSZLETEZETT
NEM RÉSZLETEZETT
NEM RÉSZLETEZETT
Szerző
Megjegyzés: This research was supported by the grant 2018-1.1.1-MKI-2018-00200 “Creating an automated quality assurance service with refactoring solutions”.
Kapcsolódó URL-ek:
Kulcsszavak: design patterns, Tree-Based CNN, source code analysis
Nyelv: angol
DOI azonosító: 10.17048/fmfai.2025.140
Felhasználó: Tibor Gál
Dátum: 28 Okt 2025 10:31
Utolsó módosítás: 28 Okt 2025 10:31
URI: http://publikacio.uni-eszterhazy.hu/id/eprint/8810
Műveletek (bejelentkezés szükséges)
Tétel nézet Tétel nézet