Comparing and experimenting machine learning techniques for code smell detection

被引:257
|
作者
Fontana, Francesca Arcelli [1 ]
Mantyla, Mika V. [4 ,5 ]
Zanoni, Marco [2 ]
Marino, Alessandro [3 ]
机构
[1] Univ Milano Bicocca, Dept Comp Sci, Milan, Italy
[2] Univ Milano Bicocca, Dept Informat Syst & Commun, Milan, Italy
[3] Univ Milano Bicocca, Milan, Italy
[4] Univ Oulu, Software Engn, Oulu, Finland
[5] Aalto Univ, Helsinki, Finland
关键词
Code smells detection; Machine learning techniques; Benchmark for code smell detection; BAD SMELLS; QUALITY; CLASSIFICATION;
D O I
10.1007/s10664-015-9378-4
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Several code smell detection tools have been developed providing different results, because smells can be subjectively interpreted, and hence detected, in different ways. In this paper, we perform the largest experiment of applying machine learning algorithms to code smells to the best of our knowledge. We experiment 16 different machine-learning algorithms on four code smells (Data Class, Large Class, Feature Envy, Long Method) and 74 software systems, with 1986 manually validated code smell samples. We found that all algorithms achieved high performances in the cross-validation data set, yet the highest performances were obtained by J48 and Random Forest, while the worst performance were achieved by support vector machines. However, the lower prevalence of code smells, i.e., imbalanced data, in the entire data set caused varying performances that need to be addressed in the future studies. We conclude that the application of machine learning to the detection of these code smells can provide high accuracy (>96 %), and only a hundred training examples are needed to reach at least 95 % accuracy.
引用
收藏
页码:1143 / 1191
页数:49
相关论文
共 50 条
  • [41] A review of code smell mining techniques
    Rasool, Ghulam
    Arshad, Zeeshan
    JOURNAL OF SOFTWARE-EVOLUTION AND PROCESS, 2015, 27 (11) : 867 - 895
  • [42] Code smell detection by deep direct-learning and transfer-learning?
    Sharma, Tushar
    Efstathiou, Vasiliki
    Louridas, Panos
    Spinellis, Diomidis
    JOURNAL OF SYSTEMS AND SOFTWARE, 2021, 176 (176)
  • [43] Comparing Machine Learning Techniques for Dementia Diagnosis
    Lins, A. J. C. C.
    Muniz, M. T. C.
    Bastos-Filho, C. J. A.
    2018 IEEE LATIN AMERICAN CONFERENCE ON COMPUTATIONAL INTELLIGENCE (LA-CCI), 2018,
  • [44] Assessment of Code Smell for Predicting Class Change Proneness Using Machine Learning
    Pritam, Nakul
    Khari, Manju
    Le Hoang Son
    Kumar, Raghvendra
    Jha, Sudan
    Priyadarshini, Ishaani
    Abdel-Basset, Mohamed
    Hoang Viet Long
    IEEE ACCESS, 2019, 7 : 37414 - 37425
  • [45] Machine learning techniques for code smells detection: an empirical experiment on a highly imbalanced setup
    Luiz, Frederico Caram
    de Oliveira Rodrigues, Bruno Rafael
    Parreiras, Fernando Silva
    PROCEEDINGS OF THE XV BRAZILIAN SYMPOSIUM ON INFORMATION SYSTEMS, SBSI 2019: Complexity on Modern Information Systems, 2019,
  • [46] FedCSD: A Federated Learning Based Approach for Code-Smell Detection
    Alawadi, Sadi
    Alkharabsheh, Khalid
    Alkhabbas, Fahed
    Kebande, Victor R.
    Awaysheh, Feras M.
    Palomba, Fabio
    Awad, Mohammed
    IEEE ACCESS, 2024, 12 : 44888 - 44904
  • [47] Improving accuracy of code smells detection using machine learning with data balancing techniques
    Khleel, Nasraldeen Alnor Adam
    Nehez, Karoly
    JOURNAL OF SUPERCOMPUTING, 2024, 80 (14): : 21048 - 21093
  • [48] Modelling Smell Events in Urban Pittsburgh with Machine and Deep Learning Techniques
    Gavros, Andreas
    Hsu, Yen-Chia
    Karatzas, Kostas
    ATMOSPHERE, 2024, 15 (06)
  • [49] Comparing the Performance of Various Supervised Machine Learning Techniques for Early Detection of Breast Cancer
    Abiodun, Moses Kazeem
    Misra, Sanjay
    Awotunde, Joseph Bamidele
    Adewole, Samson
    Joshua, Akor
    Oluranti, Jonathan
    HYBRID INTELLIGENT SYSTEMS, HIS 2021, 2022, 420 : 473 - 482
  • [50] GLITCH: Polyglot Code Smell Detection in Infrastructure as Code
    Saavedra, Nuno
    Ferreira, Joao F.
    Mendes, Alexandra
    ERCIM NEWS, 2024, (139):