DeepAI AI Chat
Log In Sign Up

On the Feasibility of Transfer-learning Code Smells using Deep Learning

04/05/2019
by   Tushar Sharma, et al.
Athens University of Economics and Business
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

03/10/2023

Software Vulnerability Prediction Knowledge Transferring Between Programming Languages

Developing automated and smart software vulnerability detection models h...
06/18/2018

Towards an efficient deep learning model for musical onset detection

In this paper, we propose an efficient and reproducible deep learning mo...
10/12/2019

Deep Transfer Learning for Source Code Modeling

In recent years, deep learning models have shown great potential in sour...
05/14/2022

Revisiting Facial Key Point Detection: An Efficient Approach Using Deep Neural Networks

Facial landmark detection is a widely researched field of deep learning ...
08/08/2021

An Empirical Study on Predictability of Software Code Smell Using Deep Learning Models

Code Smell, similar to a bad smell, is a surface indication of something...
10/23/2020

A Simple Approach for Handling Out-of-Vocabulary Identifiers in Deep Learning for Source Code

There is an emerging interest in the application of deep learning models...