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

被引:27
作者
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 条
[21]  
Fowler Martin, 1997, 11 EUROPEAN C
[22]  
Gong L., 2015, P INT S SOFTW TEST A
[23]   Alias Analysis for Optimization of Dynamic Languages [J].
Gorbovitski, Michael ;
Liu, Yanhong A. ;
Stoller, Scott D. ;
Rothamel, Tom ;
Tekle, K. Tuncay .
ACM SIGPLAN NOTICES, 2010, 45 (12) :27-41
[24]  
Grissom R.J., 2005, Effect sizes for research: A broad practical approach
[25]   Some Code Smells Have a Significant but Small Effect on Faults [J].
Hall, Tracy ;
Zhang, Min ;
Bowes, David ;
Sun, Yi .
ACM TRANSACTIONS ON SOFTWARE ENGINEERING AND METHODOLOGY, 2014, 23 (04)
[26]  
Holkner A., 2009, Proceedings of the Thirty-Second Australasian Conference on Computer Science, V91, P19
[27]   A Cooperative Parallel Search-Based Software Engineering Approach for Code-Smells Detection [J].
Kessentini, Wael ;
Kessentini, Marouane ;
Sahraoui, Houari ;
Bechikh, Slim ;
Ouni, Ali .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2014, 40 (09) :841-861
[28]   An exploratory study of the impact of antipatterns on class change- and fault-proneness [J].
Khomh, Foutse ;
Di Penta, Massimiliano ;
Gueheneuc, Yann-Gael ;
Antoniol, Giuliano .
EMPIRICAL SOFTWARE ENGINEERING, 2012, 17 (03) :243-275
[29]   An Exploratory Study of the Impact of Code Smells on Software Change-proneness [J].
Khomh, Foutse ;
Di Penta, Massimiliano ;
Gueheneuc, Yann-Gael .
16TH WORKING CONFERENCE ON REVERSE ENGINEERING (WCRE 2009), 2009, :75-+
[30]   A Bayesian Approach for the Detection of Code and Design Smells [J].
Khomh, Foutse ;
Vaucher, Stephane ;
Gueheneuc, Yann-Gael ;
Sahraoui, Houari .
2009 NINTH INTERNATIONAL CONFERENCE ON QUALITY SOFTWARE (QSIC 2009), 2009, :305-+