Code smells in pull requests: An exploratory study

Muhammad Ilyas Azeem, Saad Shafiq, Atif Mashkoor, Alexander Egyed
{"title":"Code smells in pull requests: An exploratory study","authors":"Muhammad Ilyas Azeem, Saad Shafiq, Atif Mashkoor, Alexander Egyed","doi":"10.1002/spe.3283","DOIUrl":null,"url":null,"abstract":"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.","PeriodicalId":21899,"journal":{"name":"Software: Practice and Experience","volume":"1 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2023-10-20","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Software: Practice and Experience","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1002/spe.3283","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

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.
pull请求中的代码气味:一项探索性研究
拉请求的质量是集成商接受或拒绝拉请求的主要考虑因素。代码气味表明源代码中的次优设计或实现选择通常会导致容易出错的结果,从而威胁到pull请求的质量。本研究探讨了来自25个流行Java项目的21000个拉取请求中的代码气味。我们发现接受的(37%)和拒绝的(44%)pull request都有代码异味,主要受类和长方法的影响。此外,我们观察到臭拉请求更复杂,更难以理解,因为它们具有显着的大尺寸,长延迟时间,更多的讨论和审查评论,并且是由经验较少的贡献者提交的。我们的研究结果表明,先前研究中用于拉取请求接受预测的特征可能被用于预测传入拉取请求中的气味。我们提出了一种动态方法来预测新添加的拉取请求中是否存在这种代码气味。我们在从GitHub提取的25个Java项目的数据集上评估了我们的方法。我们进一步进行基准研究,比较八种机器学习分类器的性能。基准研究结果表明,XGBoost是气味预测中表现最好的分类器。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信