Deep Learning Based Feature Envy Detection

被引:71
作者
Liu, Hui [1 ]
Xu, Zhifeng [1 ]
Zou, Yanzhen [2 ,3 ]
机构
[1] Beijing Inst Technol, Sch Comp Sci & Technol, Beijing, Peoples R China
[2] Peking Univ, Minist Educ, Key Lab High Confidence Software Technol, Beijing, Peoples R China
[3] Peking Univ, Sch Elect Engn & Comp Sci, Beijing, Peoples R China
来源
PROCEEDINGS OF THE 2018 33RD IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMTED SOFTWARE ENGINEERING (ASE' 18) | 2018年
基金
中国国家自然科学基金;
关键词
Feature Envy; Deep Learning; Software Refactoring; Code Smells; SMELLS; REFACTORINGS;
D O I
10.1145/3238147.3238166
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Software refactoring is widely employed to improve software quality. A key step in software refactoring is to identify which part of the software should be refactored. To facilitate the identification, a number of approaches have been proposed to identify certain structures in the code (called code smells) that suggest the possibility of refactoring. Most of such approaches rely on manually designed heuristics to map manually selected source code metrics to predictions. However, it is challenging to manually select the best features, especially textual features. It is also difficult to manually construct the optimal heuristics. To this end, in this paper we propose a deep learning based novel approach to detecting feature envy, one of the most common code smells. The key insight is that deep neural networks and advanced deep learning techniques could automatically select features (especially textual features) of source code for feature envy detection, and could automatically build the complex mapping between such features and predictions. We also propose an automatic approach to generating labeled training data for the neural network based classifier, which does not require any human intervention. Evaluation results on open-source applications suggest that the proposed approach significantly improves the state-of-the-art in both detecting feature envy smells and recommending destinations for identified smelly methods.
引用
收藏
页码:385 / 396
页数:12
相关论文
共 49 条
[31]  
Mikolov T., 2013, Adv Neural Inf Process Syst, P26, DOI DOI 10.48550/ARXIV.1310.4546
[32]  
Opdyke W. F., 1992, Refactoring object-oriented frameworks
[33]   Deep Sentence Embedding Using Long Short-Term Memory Networks: Analysis and Application to Information Retrieval [J].
Palangi, Hamid ;
Deng, Li ;
Shen, Yelong ;
Gao, Jianfeng ;
He, Xiaodong ;
Chen, Jianshu ;
Song, Xinying ;
Ward, Rabab .
IEEE-ACM TRANSACTIONS ON AUDIO SPEECH AND LANGUAGE PROCESSING, 2016, 24 (04) :694-707
[34]   On the diffuseness and the impact on maintainability of code smells: a large scale empirical investigation [J].
Palomba, Fabio ;
Bavota, Gabriele ;
Di Penta, Massimiliano ;
Fasano, Fausto ;
Oliveto, Rocco ;
De Lucia, Andrea .
EMPIRICAL SOFTWARE ENGINEERING, 2018, 23 (03) :1188-1221
[35]   Mining Version Histories for Detecting Code Smells [J].
Palomba, Fabio ;
Bavota, Gabriele ;
Di Penta, Massimiliano ;
Oliveto, Rocco ;
Poshyvanyk, Denys ;
De Lucia, Andrea .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2015, 41 (05) :462-489
[36]   Jointly Modeling Embedding and Translation to Bridge Video and Language [J].
Pan, Yingwei ;
Mei, Tao ;
Yao, Ting ;
Li, Houqiang ;
Rui, Yong .
2016 IEEE CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION (CVPR), 2016, :4594-4602
[37]   Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks [J].
Ren, Shaoqing ;
He, Kaiming ;
Girshick, Ross ;
Sun, Jian .
IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, 2017, 39 (06) :1137-1149
[38]  
Sales V, 2013, WORK CONF REVERSE EN, P232, DOI 10.1109/WCRE.2013.6671298
[39]  
Seng O, 2006, GECCO 2006: GENETIC AND EVOLUTIONARY COMPUTATION CONFERENCE, VOL 1 AND 2, P1909
[40]   A survey on software smells [J].
Sharma, Tushar ;
Spinellis, Diomidis .
JOURNAL OF SYSTEMS AND SOFTWARE, 2018, 138 :158-173