Return
Enhancing code smell classification with code refactoring-based data augmentation
DOI:10.1007/s10115-026-02859-2.png)
Abstract
En 中文
One of the primary challenges in training deep neural networks is the requirement for a robust and diverse data source. To address this limitation, data augmentation techniques have emerged as a promising solution, enabling the expansion of training datasets without requiring additional data collection. This study investigates the effectiveness of code refactoring-based augmentation and the role of augmented data volume in improving code smell classification in deep learning systems. We conducted a comparative analysis of rule and large language model-based augmentation with a loss penalty, an algorithmic data balancing approach for neural networks. Additionally, a novel weighting strategy was developed to optimize the evaluation of augmentation volume distribution, reducing the computational overhead while maintaining analytical precision. We used pre-trained BERT, CodeBERT, and GraphCodeBERT models to generate code embeddings and evaluated their performance for model training. Our findings demonstrate that code refactoring-based augmentation using GraphCodeBERT and large language model enhances model performance, particularly in addressing class imbalances. The impact of data volume varies depending on the size of the classes, with the greatest improvement observed during the initial augmentation increments applied to underrepresented classes. Conversely, the influence of the loss penalty, BERT, and CodeBERT-based augmentation on overall performance was found to be negligible or, in some cases, detrimental. These results emphasize the potential of code refactoring-based augmentation to drive the development of more efficient data augmentation strategies, ultimately enabling better performance in code smell classification tasks and other deep learning applications.
Keywords:
Code embedding
Data augmentation
Code smell
Code refactoring
Loss penalty
Weight factor
Classification
Journal
IF:
3.1
Papers:
545
Citations:
5.2K

