Skip to content
Open access

Enhancing code smell classification with code refactoring-based data augmentation

Sep 2026 · Knowledge and Information Systems · Vol 68 · 0 citations · 64 references
Computer Science

TL;DR

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 and demonstrates that code refactoring-based augmentation using GraphCodeBERT and large language model enhances model performance, particularly in addressing class imbalances.

Abstract

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.

Read PDF

Similar papers

Exploring Data-Efficient Adaptation of Large Language Models for Code Generation

A novel adaptation approach named DEED, which stands for D ata-E fficient adaptation with E rror-D riven learning for code generation, leverages the errors made by LLMs as learning opportunities, using error revision to overcome their own shortcomings, thus achieving efficient learning.

Xue Jiang, Zhiyuan Fan Zhi Jin YIHONG DONG, Wen-Pin Jiao et al. · 1 citation
Book Open access Nov 2026

Data Augmentation in Learning-Based Binary Code Analysis

Understanding and analyzing binary code is fundamental to security-critical tasks, such as reverse engineering and vulnerability discovery. As machine learning has become integral to these tasks, techniques from other domains have been transferred to binary code analysis. In particular, inspired by computer vision, dat...

Lennart von Stülpnagel, Felix Weissberg, Jonas Möller et al. · 0 citations
Preprint Oct 2026

VulDec: Vulnerability Detection in Binaries via Neural Decompilation

Automated vulnerability detection in binary executables is challenging due to the lack of source code and the limited semantic information available at the assembly level. Despite significant progress in machine-learning-based code analysis, the field still lacks methodologies and large, high-quality datasets that prov...

Francesco C. Grasso, Pietro Liguori, R. Natella et al. · 0 citations
#small language model Open access Nov 2026

Evaluating transformer based language model robustness under low rate training data poisoning

The recent adoption of Large Language Models (LLMs) in educational technologies, such as writing assistants, question answering systems, educational assessments, and tutoring raises concerns about the models’ trustworthiness and the potential that knowledge generated by these systems may be compromised. The present wor...

Srishti Rana, H. Lamkuche, Krishna Kumar Singh · 0 citations
Open access Nov 2026

Enhancing LLM‐Based Code Smell Prediction Using Empirical Detection Strategies

Code smells are indicators of poor design that hinder software maintainability. While existing detection methods range from rule‐based to machine‐learning approaches, they often struggle with generalizability and feature engineering issues. Recent attempts using large language models (LLMs) with simple prompts have sho...

Zi-Jie Huang, Hai-Tao Wu, Kai Shi · 0 citations
#artificial intelligence Preprint Nov 2026

BuggyMLE: Scaling Machine Learning Engineering Difficulty with Bug Injection

The Code Complexity Index (CCI), a difficulty metric based on ten structural features spanning repository scale, dependency depth, and patch size, is introduced, and BuggyMLE, a scalable framework where agents inject controlled mutations into working ML repositories is developed.

John Wu, Ru-Shi Qiang, Yu-Chen Zhuang et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.