Code smells in pull requests: An exploratory study

被引:2
作者
Azeem, Muhammad Ilyas [1 ]
Shafiq, Saad [2 ]
Mashkoor, Atif [2 ]
Egyed, Alexander [2 ]
机构
[1] Univ Luxembourg, SnT Ctr Secur Reliabil & Trust, Esch Sur Alzette, Luxembourg
[2] Johannes Kepler Univ Linz, Inst Software Syst Engn, Linz, Austria
关键词
code smell; machine learning; pull-based development; pull requests; IMPACT;
D O I
10.1002/spe.3283
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
The quality of a pull request is the primary factor integrators consider for its acceptance or rejection. Code smells indicate sub-optimal design or implementation choices in the source code that often lead to a fault-prone outcome, threatening the quality of pull requests. This study explores code smells in 21k pull requests from 25 popular Java projects. We find that both accepted (37%) and rejected (44%) pull requests have code smells, affected mainly by god classes and long methods. Besides, we observe that smelly pull requests are more complex and challenging to understand as they have significantly large sizes, long latency times, more discussion and review comments, and are submitted by contributors with less experience. Our results show that features used in previous studies for pull request acceptance prediction could be potentially employed to predict smell in incoming pull requests. We propose a dynamic approach to predict the presence of such code smells in the newly added pull requests. We evaluate our approach on a dataset of 25 Java projects extracted from GitHub. We further conduct a benchmark study to compare the performance of eight machine learning classifiers. Results of the benchmark study show that XGBoost is the best-performing classifier for smell prediction.
引用
收藏
页码:419 / 436
页数:18
相关论文
共 58 条
[1]   An Empirical Study of the Impact of Two Antipatterns, Blob and Spaghetti Code, On Program Comprehension [J].
Abbes, Marwen ;
Khomh, Foutse ;
Gueheneuc, Yann-Gael ;
Antoniol, Giuliano .
2011 15TH EUROPEAN CONFERENCE ON SOFTWARE MAINTENANCE AND REENGINEERING (CSMR), 2011, :181-190
[2]  
Aher S., 2011, INT C EM TECHN TREND, VVolume 3, P20
[3]  
Ajay V, 2016, Int J Comput Appl, V145, P36, DOI 10.5120/ijca2016910702
[4]  
Bacchelli A, 2013, PROCEEDINGS OF THE 35TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2013), P712, DOI 10.1109/ICSE.2013.6606617
[5]   SOFTWARE COMPLEXITY AND MAINTENANCE COSTS [J].
BANKER, RD ;
DATAR, SM ;
KEMERER, CF ;
ZWEIG, D .
COMMUNICATIONS OF THE ACM, 1993, 36 (11) :81-94
[6]   Analyzing the State of Static Analysis: A Large-Scale Evaluation in Open Source Software [J].
Beller, Moritz ;
Bholanath, Radjino ;
McIntosh, Shane ;
Zaidman, Andy .
2016 IEEE 23RD INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION, AND REENGINEERING (SANER), VOL 1, 2016, :470-481
[7]   Adaptive soft k-nearest-neighbour classifiers [J].
Bermejo, S ;
Cabestany, J .
PATTERN RECOGNITION, 2000, 33 (12) :1999-2005
[8]   The Promises and Perils of Mining Git [J].
Bird, Christian ;
Rigby, Peter C. ;
Barr, Earl T. ;
Hamilton, David J. ;
German, Daniel M. ;
Devanbu, Prem .
2009 6TH IEEE INTERNATIONAL WORKING CONFERENCE ON MINING SOFTWARE REPOSITORIES, 2009, :1-+
[9]   Random forests [J].
Breiman, L .
MACHINE LEARNING, 2001, 45 (01) :5-32
[10]   An empirical investigation into merge conflicts and their effect on software quality [J].
Brindescu, Caius ;
Ahmed, Iftekhar ;
Jensen, Carlos ;
Sarma, Anita .
EMPIRICAL SOFTWARE ENGINEERING, 2020, 25 (01) :562-590