Recommendation of Move Method Refactoring Using Path-Based Representation of Code
Zarina Kurbatova, Ivan Veselov, Yaroslav Golubev, and Timofey Bryksin
June, 2020. Published in the proceedings of IWoR'20 (Workshop).
Abstract. Software refactoring plays an important role in increasing code quality. One of the most popular refactoring types is the Move Method refactoring. It is usually applied when a method depends more on members of other classes than on its own original class. Several approaches have been proposed to recommend Move Method refactoring automatically. Most of them are based on heuristics and have certain limitations (e.g., they depend on the selection of metrics and manually-defined thresholds). In this paper, we propose an approach to recommend Move Method refactoring based on a path-based representation of code called code2vec that is able to capture the syntactic structure and semantic information of a code fragment. We use this code representation to train a machine learning classifier suggesting to move methods to more appropriate classes. We evaluate the approach on two publicly available datasets: a manually compiled dataset of well-known open-source projects and a synthetic dataset with automatically injected code smell instances. The results show that our approach is capable of recommending accurate refactoring opportunities and outperforms JDeodorant and JMove, which are state of the art tools in this field.
Paper Pre-printCiting publications
- Xtract: Um Plug-in Baseado em IA para Recomendações Explicáveis da Refatoração Extract Method
GA Armijo, I Ueno, VV de Camargo · Simpósio Brasileiro de … · 2026 - Engineering a Topic Modeling System: Architecture, Process, and UML Modeling
FS Ajeel, HA Abbood · Indian Journal of … · 2026 - Intelligent automated code review and software quality evaluation: a survey of AutoML and large language model techniques
RA Borgalli, U Raj, S Shetty · Automated Software Engineering · 2026 - A Text-Based Refactoring Dataset for Multi-Type Prediction Using Code Snippets and Software Metrics
A Alazba, M Alrazgan, N Al Jamaan, K Alrajhi · IEEE … · 2026 - Recommending Move Method Refactoring Opportunities Based on Feature Fusion and Deep Learning
Y Zhang, Z Gu, N Zhang · IEEE Latin America … · 2026 - An empirical study of LLM-based refactoring consistency
Y Zhang, L Yuan, C Dong · Empirical Software Engineering · 2026 - Deep Active Learning for Label-Efficient Refactoring Prediction
A Alameer, A Alazba · Information · 2026 - RefactoCNN-system: an optimized deep learning framework for predicting software refactoring opportunities using CNN-based code analysis
EL Prasanna, K Srinivas · Scientific Reports · 2026 - Predicting software refactoring opportunities using two-level TB-Stacking ensemble models
A Alameer, A Alazba · Automated Software Engineering · 2026 - From Human to Machine Refactoring: Assessing GPT-4's Impact on Python Class Quality and Readability
A Midolo, E Tramontana, M Di Penta · … of the 2026 IEEE/ACM Third … · 2026 - Analyzing the ripple effects of refactoring
M Robredo, M Esposito, F Palomba · Empirical Software … · 2026 - Systematic literature review on software code smell detection approaches
PS Thakur, SS Chouhan, SS Rathore · Journal of Systems and … · 2026 - Formalizing and Automating Fine-Grained Move Refactorings Across Methods
K Yasuhara, S Hayashi · 2026 IEEE International Conference … · 2026 - What Were You Thinking? An LLM-Driven Large-Scale Study of Refactoring Motivations in Open Source Projects
M Robredo, M Esposito, F Palomba · ACM Transactions on … · 2026 - Longitudinal Analysis of Code Smell Evolution and Refactoring Effectiveness
G Shetty · 2025 - From Core to Apex: Towards a Multi-Facet Optimization of Software Systems
A Ghammam · 2025 - Enhancing structural knowledge in code smell identification: A fusion learning framework combining AST-based metrics with semantic embeddings
Q Yang, D Yu, S Wang, Y Xu, X Chen, J Chen · Expert Systems with … · 2025 - From code to insight: studying code representation techniques for ML-based God class detection to support intelligent IDEs
E Haroon, KT Wassif, LA Zaid · Automated Software Engineering · 2025 - Data preprocessing for machine learning based code smell detection: A systematic literature review
F do Rosario Santos, R Choren · Information and Software Technology · 2025 - Reinforcement Learning vs Supervised Learning: A tug of war to generate refactored code accurately
I Palit, T Sharma · Proceedings of the 29th International Conference on … · 2025 - Together we are better: LLM, IDE and semantic embedding to assist move method refactoring
A Bellur, F Batole, MR Ullah, M Dilhara · 2025 IEEE … · 2025 - Move method refactoring recommendation based on deep learning and LLM-generated information
Y Zhang, Y Li, G Meredith, K Zheng, X Li · Information Sciences · 2025 - Exploring the potential of general purpose LLMs in automated software refactoring: an empirical study
B Liu, Y Jiang, Y Zhang, N Niu, G Li, H Liu · Automated Software … · 2025 - Deep learning-based software engineering: progress, challenges, and opportunities
X Chen, X Hu, Y Huang, H Jiang, W Ji, Y Jiang · Science China … · 2025 - Uncertainty-aware multi-objective refactoring for code duplication
DD Kurinko, VI Kryvda · Herald of Advanced Information Technology · 2025 - Automated recommendation of extracting local variable refactorings
Y Jiang, X Chi, Y Zhang, W Ji, G Li, W Wang · ACM Transactions on … · 2025 - Assessing the Impact of Refactorings on Software Attack Surface: A Case of Open-Source Software
E Edward · 2024 - Semantic and Execution-Aware Extract Method Refactoring via Self-Supervised Learning and Reinforcement Learning-Based Model Alignment
I Palit · 2024 - Predicting Code Modifications using BERT Model and Code Histories
H Aşık, E İslamoğlu, A Nizam · 2024 Innovations in Intelligent … · 2024 - On the Employment of Machine Learning for Recommending Refactorings: A Systematic Literature Review
GA Armijo, DSM Santibañez, R Durelli · Simpósio Brasileiro de … · 2024 - In Search of Metrics to Guide Developer-Based Refactoring Recommendations
M Robredo, M Esposito, F Palomba · arXiv preprint arXiv … · 2024 - Analyzing the ripple effects of refactoring. a registered report
M Robredo Manero, M Esposito · A Registered Report … · 2024 - Revealing MOVE METHOD: Machine Learning-driven Real-time Refactoring Identification for Enhanced Software Quality
VK Swain, R Panigrahi, KK Sahu · … on Emerging Systems … · 2024 - Adaptoring: Adapter Generation to Provide an Alternative API for a Library
L Reimann, G Kniesel-Wünsche · 2024 IEEE International … · 2024 - A metrics-based approach for selecting among various refactoring candidates
N Nikolaidis, N Mittas, A Ampatzoglou · Empirical Software … · 2024 - Feature envy detection based on cross-graph local semantics matching
Q Yang, D Yu, X Chen, Y Xu, W Yan, B Hu · Information and Software … · 2024 - Actionable code smell identification with fusion learning of metrics and semantics
D Yu, Q Yang, X Chen, J Chen, S Wang, Y Xu · Science of Computer … · 2024 - On the impact of refactorings on software attack surface
E Edward, AS Nyamawe, N Elisa · IEEE Access · 2024 - Mind the gap: The disconnect between refactoring criteria used in industry and refactoring recommendation tools
J Ivers, A Ghammam, K Gaaloul · 2024 IEEE … · 2024 - Detecting and resolving feature envy through automated machine learning and move method refactoring
D Al-Fraihat, Y Sharrab, AR Al-Ghuwairi · Int. J. Electr. Comput … · 2024 - Generating refactored code accurately using reinforcement learning
I Palit, T Sharma · arXiv preprint arXiv:2412.18035 · 2024 - A survey of deep learning based software refactoring
B Nyirongo, Y Jiang, H Jiang, H Liu · arXiv preprint arXiv:2404.19226 · 2024 - Three Heads Are Better Than One: Suggesting Move Method Refactoring Opportunities with Inter-class Code Entity Dependency Enhanced Hybrid Hypergraph Neural Network
D Cui, J Wang, Q Wang, P Ji, M Qiao, Y Zhao · Proceedings of the 39th … · 2024 - Machine learning-based exploration of the impact of move method refactoring on object-oriented software quality attributes
J Al Dallal, H Abdulsalam, M AlMarzouq · Arabian Journal for … · 2024 - A survey on machine learning techniques applied to source code
T Sharma, M Kechagia, S Georgiou, R Tiwari · Journal of Systems and … · 2024 - A Meta-Learning Approach for Software Refactoring
H Khosravi, A Rasoolzadegan · arXiv preprint arXiv:2301.08061 · 2023 - Automatic refactoring candidate identification leveraging effective code representation
I Palit, G Shetty, H Arif, T Sharma · 2023 IEEE International … · 2023 - Deep learning with class-level abstract syntax tree and code histories for detecting code modification requirements
OO Büyük, A Nizam · Journal of Systems and Software · 2023 - Deep learning based feature envy detection boosted by real-world examples
B Liu, H Liu, G Li, N Niu, Z Xu, Y Wang, Y Xia · Proceedings of the 31st … · 2023 - Refactoring recommendations with machine learning
GA Armijo, VV de Camargo · Simpósio Brasileiro de Qualidade de … · 2022 - All you need is logs: improving code completion by learning from anonymous IDE usage logs
V Bibaev, A Kalina, V Lomshakov, Y Golubev · Proceedings of the 30th … · 2022 - Rmove: Recommending move method refactoring opportunities using structural and semantic representations of code
D Cui, S Wang, Y Luo, X Li, J Dai · … and Evolution (ICSME … · 2022 - Recommending Extract Method Refactoring Based on Confidence of Predicted Method Name
Yamanaka, Jinto, Hayase, Yasuhiro, Amagasa, Toshiyuki · 2021 - Exploiting multi-aspect interactions for god class detection with dataset fine-tuning
S Ren, C Shi, S Zhao · 2021 IEEE 45th Annual Computers … · 2021 - Local and global feature based explainable feature envy detection
X Yin, C Shi, S Zhao · 2021 IEEE 45th Annual Computers … · 2021 - ИСПОЛЬЗОВАНИЕ МОДЕЛИРОВАНИЯ ТЕМ В ЗАДАЧАХ РАЗРАБОТКИ ПРОГРАММНОГО ОБЕСПЕЧЕНИЯ
АА Фильченков, ТА Брыксин - DETECTING CODE SMELLS WITH SPNS
M el Bouazzaoui
