Understanding metric-based detectable smells in Python']Python software: A comparative study

被引:28
作者
Chen Zhifei [1 ]
Chen Lin [1 ]
Ma Wanwangying [1 ]
Zhou Xiaoyu [2 ]
Zhou Yuming [1 ]
Xu Baowen [1 ]
机构
[1] Nanjing Univ, State Key Lab Novel Software Technol, Nanjing 210093, Jiangsu, Peoples R China
[2] Southeast Univ, Sch Comp Sci & Engn, Nanjing 210096, Jiangsu, Peoples R China
基金
中国国家自然科学基金;
关键词
!text type='Python']Python[!/text; Code smell; Detection strategy; Software maintainability; CODE-SMELLS; BAD SMELLS; IMPACT; IDENTIFICATION; PROBABILITY; AGREEMENT;
D O I
10.1016/j.infsof.2017.09.011
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
Context Code smells are supposed to cause potential comprehension and maintenance problems in software development. Although code smells are studied in many languages, e.g. Java and C#, there is a lack of technique or tool support addressing code smells in Python. Objective: Due to the great differences between Python and static languages, the goal of this study is to define and detect code smells in Python programs and to explore the effects of Python smells on software maintainability. Method: In this paper, we introduced ten code smells and established a metric-based detection method with three different filtering strategies to specify Metric thresholds (Experience-Based Strategy, Statistics-Based Strategy, and Tuning Machine Strategy). Then, we performed a Comparative study to investigate how three detection strategies perform in detecting Python smells and how these smells affect software maintainability with different detection strategies. This study utilized a corpus of 106 Python projects with most stars on GitHub. Results: The results showed that: (1) the metric-based detection approach performs well in detecting Python smells and Tuning Machine Strategy achieves the best accuracy; (2) the three detection strategies discover some different smell occurrences, and Long Parameter List and Long Method are more prevalent than other smells; (3) several kinds of code smells are more significantly related to changes or faults in Python modules. Conclusion: These findings reveal the key features of Python smells and also provide a guideline for the choice of detection strategy in detecting and analyzing Python smells.
引用
收藏
页码:14 / 29
页数:16
相关论文
共 64 条
[11]   Dynamic Slicing of Python']Python Programs [J].
Chen, Zhifei ;
Chen, Lin ;
Zhou, Yuming ;
Xu, Zhaogui ;
Chu, William C. ;
Xu, Baowen .
2014 IEEE 38TH ANNUAL INTERNATIONAL COMPUTERS, SOFTWARE AND APPLICATIONS CONFERENCE (COMPSAC), 2014, :219-228
[12]   A COEFFICIENT OF AGREEMENT FOR NOMINAL SCALES [J].
COHEN, J .
EDUCATIONAL AND PSYCHOLOGICAL MEASUREMENT, 1960, 20 (01) :37-46
[13]   The Analysis of Count Data: A Gentle Introduction to Poisson Regression and Its Alternatives [J].
Coxe, Stefany ;
West, Stephen G. ;
Aiken, Leona S. .
JOURNAL OF PERSONALITY ASSESSMENT, 2009, 91 (02) :121-136
[14]  
D'Ambros Marco, 2010, Proceedings of the Tenth International Conference on Quality Software (QSIC 2010), P23, DOI 10.1109/QSIC.2010.58
[15]   A controlled experiment investigation of an object-oriented design heuristic for maintainability [J].
Deligiannis, I ;
Stamelos, I ;
Angelis, L ;
Roumeliotis, M ;
Shepperd, M .
JOURNAL OF SYSTEMS AND SOFTWARE, 2004, 72 (02) :129-143
[16]  
Du Bois Bart., 2006, IASTED C SOFTWARE EN, P346
[17]  
Fard AM, 2013, IEEE INT WORK C SO, P116, DOI 10.1109/SCAM.2013.6648192
[18]  
FLEISS JL, 1971, PSYCHOL BULL, V76, P378, DOI 10.1037/h0031619
[19]   Automatic metric thresholds derivation for code smell detection [J].
Fontana, Francesca Arcelli ;
Ferme, Vincenzo ;
Zanoni, Marco ;
Yamashita, Aiko .
PROCEEDINGS SIXTH INTERNATIONAL WORKSHOP ON EMERGING TRENDS IN SOFTWARE METRICS WETSOM 2015, 2015, :44-53
[20]   Code Smell Detection: Towards a Machine Learning-based Approach [J].
Fontana, Francesca Arcelli ;
Zanoni, Marco ;
Marino, Alessandro ;
Mantyla, Mika V. .
2013 29TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE (ICSM), 2013, :396-399