Automatic Human-Like Detection of Code Smells

被引:3
作者
Soomlek, Chitsutha [1 ]
van Rijn, Jan N. [2 ]
Bonsangue, Marcello M. [2 ]
机构
[1] Khon Kaen Univ, Dept Comp Sci, Khon Kaen, Thailand
[2] Leiden Univ, Leiden Inst Adv Comp Sci, Leiden, Netherlands
来源
DISCOVERY SCIENCE (DS 2021) | 2021年 / 12986卷
关键词
Code smells; Machine learning; Software engineering;
D O I
10.1007/978-3-030-88942-5_2
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
Many code smell detection techniques and tools have been proposed, mainly aiming to eliminate design flaws and improve software quality. Most of them are based on heuristics which rely on a set of software metrics and corresponding threshold values. Those techniques and tools suffer from subjectivity issues, discordant results among the tools, and the reliability of the thresholds. To mitigate these problems, we used machine learning to automate developers' perception in code smells detection. Different from other existing machine learning used in code smell detection we trained our models with an extensive dataset based on more than 3000 professional reviews on 518 open source projects. We conclude by an empirical evaluation of the performance of the machine learning approach against PMD, a widely used metric-based code smell detection tool for Java. The experimental results show that the machine learning approach outperforms the PMD classifier in all evaluations.
引用
收藏
页码:19 / 28
页数:10
相关论文
共 30 条
[1]   On Relating Code Smells to Security Vulnerabilities [J].
Abu Elkhail, Abdulrahman ;
Cerny, Tomas .
2019 IEEE 5TH INTL CONFERENCE ON BIG DATA SECURITY ON CLOUD (BIGDATASECURITY) / IEEE INTL CONFERENCE ON HIGH PERFORMANCE AND SMART COMPUTING (HPSC) / IEEE INTL CONFERENCE ON INTELLIGENT DATA AND SECURITY (IDS), 2019, :7-12
[2]  
Amorim L, 2015, 2015 IEEE 26TH INTERNATIONAL SYMPOSIUM ON SOFTWARE RELIABILITY ENGINEERING (ISSRE), P261, DOI 10.1109/ISSRE.2015.7381819
[3]  
[Anonymous], PMD EXT CROSS LANG S
[4]  
[Anonymous], UNDERSTAND SCITOOLS
[5]   Machine learning techniques for code smell detection: A systematic literature review and meta-analysis [J].
Azeem, Muhammad Ilyas ;
Palomba, Fabio ;
Shi, Lin ;
Wang, Qing .
INFORMATION AND SOFTWARE TECHNOLOGY, 2019, 108 :115-138
[6]   Random forests [J].
Breiman, L .
MACHINE LEARNING, 2001, 45 (01) :5-32
[7]  
CHIDAMBER SR, 1991, OOPSLA 91 CONFERENCE PROCEEDINGS : OBJECT-ORIENTED PROGRAMMING SYSTEMS, LANGUAGES, AND APPLICATIONS, P197, DOI 10.1145/118014.117970
[8]  
Di Nucci D, 2018, 2018 25TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION AND REENGINEERING (SANER 2018), P612, DOI 10.1109/SANER.2018.8330266
[9]   A Review-based Comparative Study of Bad Smell Detection Tools [J].
Fernandes, Eduardo ;
Oliveira, Johnatan ;
Vale, Gustavo ;
Paiva, Thanis ;
Figueiredo, Eduardo .
PROCEEDINGS OF THE 20TH INTERNATIONAL CONFERENCE ON EVALUATION AND ASSESSMENT IN SOFTWARE ENGINEERING 2016 (EASE '16), 2016,
[10]   Comparing and experimenting machine learning techniques for code smell detection [J].
Fontana, Francesca Arcelli ;
Mantyla, Mika V. ;
Zanoni, Marco ;
Marino, Alessandro .
EMPIRICAL SOFTWARE ENGINEERING, 2016, 21 (03) :1143-1191