AI & ML
A GNN-Based Approach for Code Smell Detection and Refactoring Opportunity Identification
arXiv cs.SE0 views
arXiv:2511.12069v5 Announce Type: replace Abstract: Code smells indicate latent design or implementation problems that may negatively affect software maintainability. Over the past decades, numerous approaches have been proposed for code smell refactoring, including those based on software metrics, predefined rules, machine learning/deep learning (ML/DL), and, more recently, large language models (LLMs). However, traditional metric- and rule-based approaches rely heavily on manually defined criteria, while ML/DL approaches are often constrained by the availability of training data and the design of model architectures. Although LLMs provide advanced code understanding capabilities, they typically incur substantial computational and time costs, particularly when applied to large-scale software systems. In this study, we propose a graph-based deep learning approach for code smell refactoring. Specifically, we construct code graphs at both the class and method levels and employ graph- and node-level classification to detect code smells and identify corresponding refactoring opportunities for three representative code smells: Long Method, Large Class, and Feature Envy. The proposed approach is trained and evaluated using SACS, a large-scale open-source dataset constructed through a semi-automated process. In the experiments, we implement the proposed approach using three representative GNN architectures: GCN, GraphSAGE, and GAT. We further compare its performance with traditional refactoring approaches, an existing deep learning-based approach, and four representative lightweight LLMs. Experimental results show that the proposed approach outperforms the compared approaches across all evaluated code smell refactoring tasks, demonstrating that it provides both superior performance and greater efficiency.
Source:https://arxiv.org/abs/2511.12069PreviousBigCodeArena: Unveiling More Reliable Human Preferences in Code Generation via ExecutionNextFrom Conversation to Evaluation: Benchmarking LLMs on Development Knowledge via SimpleDevQA
Related posts
Coordinate Frame Recovery, Per Class NMS and Null Return Modelling for Sim2Real V2X LiDAR Detection
0arXiv cs.RO
Geometric Refinement and Distributional Alignment for Sim2Real Roadside LiDAR Detection
0arXiv cs.RO
D-VLA: A High-Concurrency Distributed Asynchronous Reinforcement Learning Framework for Vision-Language-Action Models
0arXiv cs.RO
Beyond Trajectory Similarity: Evaluating Surgical Planning by Protocol Adherence
0arXiv cs.RO
HEIR: Harness Egocentric Intent for Human-Robot Interactions
0arXiv cs.RO
EmbodiExp: Compositional Experience Transfer for Embodied Agents
0arXiv cs.RO