On the Feasibility of Transfer-learning Code Smells using Deep Learning
Not on the map. Why?
Abstract (arXiv)
Context: A substantial amount of work has been done to detect smells in source code using metrics-based and heuristics-based methods. Machine learning methods have been recently applied to detect source code smells; however, the current practices are considered far from mature. Objective: First, explore the feasibility of applying deep learning models to detect smells without extensive feature engineering, just by feeding the source code in tokenized form. Second, investigate the possibility of applying transfer-learning in the context of deep learning models for smell detection. Method: We use existing metric-based state-of-the-art methods for detecting three implementation smells and one design smell in C# code. Using these results as the annotated gold standard, we train smell detection models on three different deep learning architectures. These architectures use Convolution Neural Networks (CNNs) of one or two dimensions, or Recurrent Neural Networks (RNNs) as their principal hidden layers. For the first objective of our study, we perform training and evaluation on C# samples, whereas for the second objective, we train the models from C# code and evaluate the models over Java code samples. We perform the experiments with various combinations of hyper-parameters for each model. Results: We find it feasible to detect smells using deep learning methods. Our comparative experiments find that there is no clearly superior method between CNN-1D and CNN-2D. We also observe that performance of the deep learning models is smell-specific. Our transfer-learning experiments show that transfer-learning is definitely feasible for implementation smells with performance comparable to that of direct-learning. This work opens up a new paradigm to detect code smells by transfer-learning especially for the programming languages where the comprehensive code smell detection tools are not available.
Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). First posted on arXiv 5 Apr 2019.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 3; 2022: 0; 2023: 2; 2024: 1; 2025: 1.
7 papers.
- 2021Neural Transfer Learning for Repairing Security Vulnerabilities in C Codecited by 36
- 2021A Survey on Machine Learning Techniques for Source Code Analysiscited by 23
- 2021Improving Code Autocompletion with Transfer Learningcited by 6
- 2023DACOS-A Manually Annotated Dataset of Code Smellscited by 2
- 2023Redundancy and Concept Analysis for Code-trained Language Modelscited by 1
- 2024Enhancing Source Code Classification Effectiveness via Prompt Learning Incorporating Knowledge Featurescited by 1
- 2025Discovering Software Parallelization Points Using Deep Neural Networkscited by 1
- 2025Discovering Software Parallelization Points Using Deep Neural Networks5 Sep 2025
- 2024Enhancing Source Code Classification Effectiveness via Prompt Learning Incorporating Knowledge Features10 Jan 2024
- 2023Redundancy and Concept Analysis for Code-trained Language Models1 May 2023
- 2023DACOS-A Manually Annotated Dataset of Code Smells15 Mar 2023
- 2021A Survey on Machine Learning Techniques for Source Code Analysis18 Oct 2021
- 2021Improving Code Autocompletion with Transfer Learning12 May 2021
- 2021Neural Transfer Learning for Repairing Security Vulnerabilities in C Code16 Apr 2021