Code smells and their collocations: A large-scale experiment on open-source systems

被引:23
作者
Walter, Bartosz [1 ]
Fontana, Francesca Arcelli [2 ]
Ferme, Vincenzo [3 ]
机构
[1] Poznan Univ Tech, Fac Comp, Poznan, Poland
[2] Univ Milano Bicocca, Dept Informat Syst & Commun, Milan, Italy
[3] USI Lugano, Fac Informat, Software Inst, Lugano, Switzerland
关键词
Code smells; Inter-smell relationships; Smell interaction; Collocated smells; Code smell detectors; Source code quality; BAD SMELLS; PROBABILITY;
D O I
10.1016/j.jss.2018.05.057
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Code smells indicate possible flaws in software design, that could negatively affect system's maintainability. Interactions among smells located in the same classes (i.e., collocated smells) have even more detrimental effect on quality. Extracted frequent patterns of collocated smells could help to understand practical consequences of collocations. In this paper we identify and empirically validate frequent collocations of 14 code smells detected in 92 Java systems, using three approaches: pairwise correlation analysis, PCA and associative rules. To cross validate the results, we used up to 6 detectors for each smell. Additionally, we examine and compare techniques used to extract the relationships. The contribution is three-fold: (1) we identify and empirically validate relationships among the examined code smells on a large dataset that we made publicly available, (2) we discuss how the choice of code smell detectors affects results, and (3) we analyze the impact of software domain on existence of the smell collocations. Additionally, we found that analytical methods we used to discover collocations, are complementary. Smells collocations display recurring patterns that could help prioritizing the classes affected by code smells to be refactored and developing or enhancing detectors exploiting information about collocations. They can also help the developers focusing on classes deserving more maintenance effort.
引用
收藏
页码:1 / 21
页数:21
相关论文
共 67 条
  • [1] An Empirical Study of the Impact of Two Antipatterns, Blob and Spaghetti Code, On Program Comprehension
    Abbes, Marwen
    Khomh, Foutse
    Gueheneuc, Yann-Gael
    Antoniol, Giuliano
    [J]. 2011 15TH EUROPEAN CONFERENCE ON SOFTWARE MAINTENANCE AND REENGINEERING (CSMR), 2011, : 181 - 190
  • [2] Agrawal R., 1993, SIGMOD Record, V22, P207, DOI 10.1145/170036.170072
  • [3] Agrawal R., 1996, ADV KNOWLEDGE DISCOV, V12, P307, DOI DOI 10.1007/978-3-319-31750-2.
  • [4] [Anonymous], 2010, 2010 IEEE International Conference on Software Maintenance, DOI [10.1109/ICSM.2010.5609564, DOI 10.1109/ICSM.2010.5609564]
  • [5] Arcelli Fontana F., 2015, P IEEE SAM 2015 WORK
  • [6] Arcelli Fontana F., 2015, P 7 INT WORKSH MAN T
  • [7] Arcoverde R., 2011, Proceedings of the 4th Workshop on Refactoring Tools. WRT 11, P33, DOI DOI 10.1145/1984732.1984740
  • [8] Azadi U., 2018, P 40 INT C SOFTW ENG
  • [9] Azevedo PJ, 2007, LECT NOTES ARTIF INT, V4701, P510
  • [10] Bartlett KS, 1937, MATH PHYS ENG SCI, V160, P268, DOI [10.1098/rspa.1937.0109, DOI 10.1098/RSPA.1937.0109]