Machine Learning Techniques for Code Smells Detection: A Systematic Mapping Study

被引:33
作者
Caram, Frederico Luiz [1 ]
De Oliveira Rodrigues, Bruno Rafael [1 ]
Campanelli, Amadeu Silveira [1 ]
Parreiras, Fernando Silva [1 ]
机构
[1] FUMEC Univ, LAIS Lab Adv Informat Syst, Av Afonso Pena 3880, BR-30130009 Belo Horizonte, MG, Brazil
关键词
Machine learning; code smells; refactoring; BAD SMELLS; REFACTORING OPPORTUNITIES; EVOLUTION;
D O I
10.1142/S021819401950013X
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
Code smells or bad smells are an accepted approach to identify design flaws in the source code. Although it has been explored by researchers, the interpretation of programmers is rather subjective. One way to deal with this subjectivity is to use machine learning techniques. This paper provides the reader with an overview of machine learning techniques and code smells found in the literature, aiming at determining which methods and practices are used when applying machine learning for code smells identification and which machine learning techniques have been used for code smells identification. A mapping study was used to identify the techniques used for each smell. We found that the Bloaters was the main kind of smell studied, addressed by 35% of the papers. The most commonly used technique was Genetic Algorithms (GA), used by 22.22% of the papers. Regarding the smells addressed by each technique, there was a high level of redundancy, in a way that the smells are covered by a wide range of algorithms. Nevertheless, Feature Envy stood out, being targeted by 63% of the techniques. When it comes to performance, the best average was provided by Decision Tree, followed by Random Forest, Semi-supervised and Support Vector Machine Classifier techniques. 5 out of the 25 analyzed smells were not handled by any machine learning techniques. Most of them focus on several code smells and in general there is no outperforming technique, except for a few specific smells. We also found a lack of comparable results due to the heterogeneity of the data sources and of the provided results. We recommend the pursuit of further empirical studies to assess the performance of these techniques in a standardized dataset to improve the comparison reliability and replicability.
引用
收藏
页码:285 / 316
页数:32
相关论文
共 75 条
[1]  
Abran A., 1993, Journal of Software Maintenance: Research and Practice, V5, P63, DOI 10.1002/smr.4360050202
[2]   An integrated measure of software maintainability [J].
Aggarwal, KK ;
Singh, Y ;
Chhabra, JK .
ANNUAL RELIABILITY AND MAINTAINABILITY SYMPOSIUM, 2002 PROCEEDINGS, 2002, :235-241
[3]   Support vector machines combined with feature selection for breast cancer diagnosis [J].
Akay, Mehmet Fatih .
EXPERT SYSTEMS WITH APPLICATIONS, 2009, 36 (02) :3240-3247
[4]   Identifying refactoring opportunities in object-oriented code: A systematic literature review [J].
Al Dallal, Jehad .
INFORMATION AND SOFTWARE TECHNOLOGY, 2015, 58 :231-249
[5]   Identifying Extract Class refactoring opportunities using structural and semantic cohesion measures [J].
Bavota, Gabriele ;
De Lucia, Andrea ;
Oliveto, Rocco .
JOURNAL OF SYSTEMS AND SOFTWARE, 2011, 84 (03) :397-414
[6]  
Bennett KH, 2000, P C FUT SOFTW ENG, P73
[7]   Mining static and dynamic crosscutting concerns: a role-based approach [J].
Bernardi, Mario Luca ;
Cimitile, Marta ;
Di Lucca, Giuseppe .
JOURNAL OF SOFTWARE-EVOLUTION AND PROCESS, 2016, 28 (05) :306-339
[8]  
Brown W. J., 1998, ANTIPATTERNS REFACTO, V3
[9]   Reducing Subjectivity in Code Smells Detection: Experimenting with the Long Method [J].
Bryton, Sergio ;
Brito e Abreu, Fernando ;
Monteiro, Miguel .
QUATIC 2010: SEVENTH INTERNATIONAL CONFERENCE ON THE QUALITY OF INFORMATION AND COMMUNICATIONS TECHNOLOGY, 2010, :337-342
[10]   Strengthening Refactoring: Towards Software Evolution with Quantitative and Experimental Grounds [J].
Bryton, Sergio ;
Brito e Abreu, Fernando .
2009 FOURTH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING ADVANCES (ICSEA 2009), 2009, :570-575