当前位置: X-MOL 学术J. Syst. Softw. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Code smell detection by deep direct-learning and transfer-learning
Journal of Systems and Software ( IF 3.5 ) Pub Date : 2021-03-06 , DOI: 10.1016/j.jss.2021.110936
Tushar Sharma , Vasiliki Efstathiou , Panos Louridas , Diomidis Spinellis

Context:

An excessive number of code smells make a software system hard to evolve and maintain. Machine learning methods, in addition to metric-based and heuristic-based methods, have been recently applied to detect code smells; however, current methods are considered far from mature.

Objective:

First, explore the feasibility of applying deep learning models to detect smells without extensive feature engineering. Second, investigate the possibility of applying transfer-learning in the context of detecting code smells.

Methods:

We train smell detection models based on Convolution Neural Networks and Recurrent Neural Networks as their principal hidden layers along with autoencoder models. For the first objective, 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 and vice-versa.

Results:

We find it feasible to detect smells using deep learning methods though the models’ performance is smell-specific. Our 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.



中文翻译:

通过深度直接学习和转移学习进行代码气味检测

语境:

过多的代码气味使软件系统难以开发和维护。除了基于度量和基于启发式的方法之外,机器学习方法最近还被用于检测代码气味。但是,目前的方法还远远没有成熟。

客观的:

首先,探索在无需进行广泛的功能工程的情况下将深度学习模型用于检测气味的可行性。其次,研究在检测代码气味的情况下应用转移学习的可能性。

方法:

我们训练基于卷积神经网络和递归神经网络作为主要隐藏层的气味检测模型以及自动编码器模型。对于第一个目标,我们对C#样本执行训练和评估,而对于第二个目标,我们从C#代码训练模型并在Java代码样本上评估模型,反之亦然。

结果:

我们发现使用深度学习方法检测气味是可行的,尽管模型的性能是特定于气味的。我们的实验表明,转移学习对于实现气味绝对可行,其性能可与直接学习媲美。这项工作为通过转移学习来检测代码气味开辟了一个新的范例,特别是对于那些没有全面的代码气味检测工具的编程语言而言。

更新日期:2021-03-09
down
wechat
bug