Recent Advances in Computer Science and Communications

Author(s): Aziz Nanthaamornphong and Ekkarat Boonchieng*

DOI: 10.2174/2666255816666230222112313

An Exploratory Study on Code Smells during Code Review in OSS Projects: A Case Study on OpenStack and WikiMedia

Article ID: e220223213896 Pages: 14

  • * (Excluding Mailing and Handling)

Abstract

Objective: Open-source software (OSS) has become an important choice for developing software applications, and its usage has exponentially increased in recent years. Although many OSS systems have shown high reliability in terms of their functionality, they often exhibit several quality issues. Since most developers focus primarily on meeting clients’ functional requirements within the appropriate deadlines, the outcome suffers from poor design and implementation practices. This issue can also manifest as software code smells, resulting in a variety of quality issues such as software maintainability, comprehensibility, and extensibility. Generally speaking, OSS developers use code reviews during their software development to discover flaws or bugs in the updated code before it is merged with the code base. Nevertheless, despite the harmful impacts of code smells on software projects, the extent to which developers do consider them in the code review process is unclear in practice.

Methods: To better understand the code review process in OSS projects, we gathered the comments of code reviewers who specified where developers should fix code smells in two OSS projects, OpenStack and WikiMedia, between 2011 and 2015.

Results: Our findings indicate that most code reviewers do not pay much attention to code smells. Only a few code reviewers have attempted to motivate developers to improve their source code quality in general. The results also show that there is an increasing tendency to provide advice concerning code smells corrections over time.

Conclusion: We believe that this study's findings will encourage developers to use new software engineering practices, such as refactoring, to reduce code smells when developing OSS.

Graphical Abstract

[1]
Statista Inc. Open source services market revenue world- wide 2017-2022, Available from: https://www.statista.com/statistics/270805/projected-revenue-of-open-source-software-since-2008/ (Accessed on: 14 Dec 2022).
[2]
M. Aberdour, "Achieving quality in open-source software", IEEE Softw., vol. 24, no. 1, pp. 58-64, 2007.
[http://dx.doi.org/10.1109/MS.2007.2]
[3]
GitHub, Available from: https://github.com/ (Accessed on: 14 Dec 2022).
[4]
Gerrit Code Review, Available from: https://www. gerritcodereview.com/ (Accessed on: 14 Dec 2022).
[5]
Y. Zhou, and J. Davis, "Open source software reliability model: An empirical approach", SIGSOFT Softw. Eng. Notes, vol. 30, no. 4, pp. 1-6, 2005.
[http://dx.doi.org/10.1145/1082983.1083273]
[6]
H. Wu, L. Shi, C. Chen, Q. Wang, and B. Boehm, "Maintenance effort estimation for open source software: A systematic literature review", Proceedings of the 2016 IEEE International Conference on Software Maintenance and Evolution (ICSME), 2016, pp. 32-43.
[http://dx.doi.org/10.1109/ICSME.2016.87]
[7]
A. Yamashita, and L. Moonen, "Do developers care about code smells? an exploratory survey", Proceedings of the 2013 20th Working Conference on Reverse Engineering (WCRE), 2013, pp. 242-251.
[http://dx.doi.org/10.1109/WCRE.2013.6671299]
[8]
O. Baysal, O. Kononenko, R. Holmes, and M.W. Godfrey, "The influence of non-technical factors on code review", Proceedings of the 2013 20th working conference on reverse engineering (WCRE), 2013, pp. 122-131.
[http://dx.doi.org/10.1109/WCRE.2013.6671287]
[9]
A.F. Ackerman, L.S. Buchwald, and F.H. Lewski, "Software inspections: an effective verification process", IEEE Softw., vol. 6, no. 3, pp. 31-36, 1989.
[http://dx.doi.org/10.1109/52.28121]
[10]
"IEEE standard for software reviews In:", IEEE Std 1028-1997, pp. 1-48, 1998.
[11]
J.W. Paulson, G. Succi, and A. Eberlein, "An empirical study of open-source and closed-source software products", IEEE Trans. Softw. Eng., vol. 30, no. 4, pp. 246-256, 2004.
[http://dx.doi.org/10.1109/TSE.2004.1274044]
[12]
T.J. Halloran, and W.L. Scherlis, High quality and open source software practices. Available from: http://users.ece.utexas.edu/~perry/education/382v-s08/papers/halloran.pdf (Accessed on: 14 Dec 2022).
[13]
M. Fowler, Refactoring: Improving the design of existing code. 2nd edition, Boston, MA, USA:. Addison-Wesley Professional, 2018.
[14]
F. Khomh, M.D. Penta, Y.G. Guéhéneuc, and G. Antoniol, "An exploratory study of the impact of antipatterns on class change- and fault-proneness", Empir. Softw. Eng., vol. 17, no. 3, pp. 243-275, 2012.
[http://dx.doi.org/10.1007/s10664-011-9171-y]
[15]
An OpenInfra Project, Open source cloud computing infrastructure - OpenStack, Available from: https://www.openstack.org/ (Accessed on: 14 Dec 2022).
[16]
WikiMedia, Available from: https://www.wikimedia.org/ (Accessed on: 14 Dec 2022).
[17]
A. Bosu, and J.C. Carver, Impact of peer code review on peer impression formation: A survey2013 ACM/IEEE International Symposium on Empirical Software Engineering and Measurement, 2013, pp. 133-142.
[http://dx.doi.org/10.1109/ESEM.2013.23]
[18]
A. Bosu, and J.C. Carver, Impact of developer reputation on code review outcomes in oss projects: An empirical investigationProceedings of the 8th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement, 2014, pp. 1-10.
[http://dx.doi.org/10.1145/2652524.2652544]
[19]
A. Ouni, R.G. Kula, and K. Inoue, Search-based peer reviewers recommendation in modern code reviewProceedings of the 2016 IEEE International Conference on Software Maintenance and Evolution (ICSME), 2016, pp. 367-377.
[http://dx.doi.org/10.1109/ICSME.2016.65]
[20]
P. Thongtanunam, R.G. Kula, A.E.C. Cruz, N. Yoshida, and H. Iida, "Improving code review effectiveness through reviewer recommendations", Cooperative and Human Aspects of Software EngineeringAt: workshop co-located with ICSE2014, 2014, pp. 119-122.
[http://dx.doi.org/10.1145/2593702.2593705]
[21]
X. Xia, D. Lo, X. Wang, and X. Yang, Who should reviewt his change?: Putting text and file location analyses together for more accurate recommendationsProceedings of the 2015 IEEE International Conference on Software Maintenance and Evolution (ICSME), 2015, pp. 261-270.
[http://dx.doi.org/10.1109/ICSM.2015.7332472]
[22]
M. Beller, A. Bacchelli, A. Zaidman, and E. Juergens, Modern code reviews in open-source projects: Which problems do they fix?11th Working Conference on Mining Software Repositories, 2014, pp. 202-211.
[http://dx.doi.org/10.1145/2597073.2597082]
[23]
A. Bacchelli, and C. Bird, Expectations, outcomes, and challenges of modern code reviewProceedings of the 2013 35th International Conference on Software Engineering (ICSE), 2013, pp. 712-721.
[http://dx.doi.org/10.1109/ICSE.2013.6606617]
[24]
E.V.P. Sobrinho, A. De Lucia, and M.A. Maia, "A systematic literature review on bad smells–5 w’s: Which, when, what, who, where", IEEE Trans. Softw. Eng., vol. 47, no. 1, pp. 17-66, 2021.
[http://dx.doi.org/10.1109/TSE.2018.2880977]
[25]
Y. Tao, D. Han, and S. Kim, Writing acceptable patches: An empirical study of open source project patchesProceedings of the 2014 IEEE International Conference on Software Maintenance and Evolution, 2014, pp. 271-280.
[http://dx.doi.org/10.1109/ICSME.2014.49]
[26]
A. Bosu, M. Greiler, and C. Bird, "Characteristics of useful code reviews: An empirical study at microsoft", Proceedings of the 2015 IEEE/ACM 12th Working Conference on Mining Software Repositories, 2015, pp. 146-156.
[http://dx.doi.org/10.1109/MSR.2015.21]
[27]
T. Baum, O. Liskin, K. Niklas, and K. Schneider, "Factors influencing code review processes in industry", Proceedings of the 2016 24th acm Sigsoft International Symposium on Foundations of Software Engineering, 2016, Nov 16; Seattle, USA: Association for Computing Machinery, 2016, pp. 85-96.
[http://dx.doi.org/10.1145/2950290.2950323]
[28]
N. Sae-Lim, S. Hayashi, and M. Saeki, "An investigative study on how developers filter and prioritize code smells", IEICE Trans. Inf. Syst., vol. E101, no. D, pp. 1733-1742, 2018.
[http://dx.doi.org/10.1587/transinf.2017KBP0006]
[29]
T. Koponen, and V. Hotti, "Open source software maintenance process framework", Proceedings of the 5th Workshop on Open Source Software Engineering 2005 May; New York, USA: Association for Computing Machinery, 2005, pp. 1-5.
[30]
A. Raza, L.F. Capretz, and F. Ahmed, Maintenance support in open source software projectsProceedings of the 8th International Conference on Digital Information Management (ICDIM 2013), 2013, pp. 391-395.
[http://dx.doi.org/10.1109/ICDIM.2013.6694005]
[31]
V. Midha, and A. Bhattacherjee, "Governance practices and software maintenance: A study of open source projects", Decis. Support Syst., vol. 54, no. 1, pp. 23-32, 2012.
[http://dx.doi.org/10.1016/j.dss.2012.03.002]
[32]
C.J. Xiong, Y.F. Li, M. Xie, S. Ng, and T. Goh, A model of open source software maintenance activitiesProceedings of the 2009 IEEE International Conference on Industrial Engineering and Engineering Management, 2009, pp. 267-271.
[http://dx.doi.org/10.1109/IEEM.2009.5373367]
[33]
M. Ó Cinnéide, A. Yamashita, and S. Counsell, Measuring refactoring benefits: a survey of the evidenceProceedings of the 1st International Workshop on Software Refactoring, 2016, pp. 9-12.
[http://dx.doi.org/10.1145/2975945.2975948]
[34]
A. Ouni, M. Kessentini, H. Sahraoui, and M. Boukadoum, "Maintainability defects detection and correction: a multi-objective approach", Autom. Softw. Eng., vol. 20, no. 1, pp. 47-79, 2013.
[http://dx.doi.org/10.1007/s10515-011-0098-8]
[35]
W. Kessentini, M. Kessentini, H. Sahraoui, S. Bechikh, and A. Ouni, "A cooperative parallel search-based software engineering approach for code smells detection", IEEE Trans. Softw. Eng., vol. 40, no. 9, pp. 841-861, 2014.
[http://dx.doi.org/10.1109/TSE.2014.2331057]
[36]
M. Kessentini, W. Kessentini, H. Sahraoui, M. Boukadoum, and A. Ouni, "Design defects detection and correction by example", Proceedings of the 2011 IEEE 19th International Conference on Program Comprehension, 2011, pp. 81-90.
[http://dx.doi.org/10.1109/ICPC.2011.22]
[37]
A. Ouni, M. Kessentini, H. Sahraoui, K. Inoue, and K. Deb, "Multi-criteria code refactoring using search-based software engineering: An industrial case study", ACM Transactions on Software Engineering and Methodology, vol. 25, no. 3, pp. 1-53, 2016.
[http://dx.doi.org/10.1145/2932631]
[38]
A. Ouni, M. Kessentini, H. Sahraoui, and M.S. Hamdi, Search-based refactoring: Towards semantics preservationProceedings of the 2012 28th IEEE International Conference on Software Maintenance (ICSM), 2012, pp. 347-356.
[http://dx.doi.org/10.1109/ICSM.2012.6405292]
[39]
A. Ouni, M. Kessentini, H. Sahraoui, K. Inoue, and M.S. Hamdi, ""Improving multi-objective code-smells correction using development history", J. Syst. Softw, vol. 105, no. 2015, pp. 18-39, 2015.
[http://dx.doi.org/10.1016/j.jss.2015.03.040]
[40]
A. Ouni, M. Kessentini, M. Ó Cinnéide, H. Sahraoui, K. Deb, and K. Inoue, "MORE: A multi-objective refactoring recommendation approach to introducing design patterns and fixing code smells", J. Softw..
vol. 29, no. 5, 2017.e1843. [http://dx.doi.org/10.1002/smr.1843]
[41]
A. Nanthaamornphongand, and A. Chaisutanon, Empirical evaluation of code smells in open source projects: preliminary resultsProceedings of the 1st International Workshop on Software Refactoring, 2016, pp. 5-8.
[http://dx.doi.org/10.1145/2975945.2975947]
[42]
A. Nanthaamornphong, Codesmells-OSS. Available from: https://github.com/azizn/codesmells-oss/blob/master/listofkeywords. csv (Accessed on: 14 Dec 2022).
[43]
The Comprehensive R Archive Network, CRAN - Package Wordnet. Available from: https://cran.r-project.org/web/packages/wordnet/index.html (Accessed on: 14 Dec 2022).
[44]
E. Al Omar, M.W. Mkaouer, and A. Ouni, "Can refactoring be selfaffirmed? an exploratory study on how developers document their refactoring activities in commit messages", Proceedings of the 2019 IEEE/ACM 3rd International Workshop on Refactoring (IWoR),, 2019, pp. 51-58.
[http://dx.doi.org/10.1109/IWoR.2019.00017]
[45]
OpenDev, Strength reduction in the get_collection loop (if8a00d5a), Available from: https://review.opendev.org/c/openstack/neutron-lib/+/647707/ (Accessed on: 14 Dec 2022).
[46]
D.M. Blei, A.Y. Ng, and M.I. Jordan, "Latent dirichlet allocation", J. Mach. Learn. Res., vol. 3, pp. 993-1022, 2003.
[47]
J.C. Campbell, A. Hindle, and E. Stroulia, Latent dirichlet allocation: Extracting topics from software engineering data., In: The Art and Science of Analyzing Software Data., Elsevier: Amsterdam, 2015, pp. 139-159.
[http://dx.doi.org/10.1016/B978-0-12-411519-4.00006-9]
[48]
The Comprehensive R Archive Network, CRAN - Package LDA, Available from: project.org/web/packages/lda/index.html (Accessed on: 14 Dec 2022).
[49]
P. Willett, "The porter stemming algorithm: Then and now", vol. 40, no. 3, pp. 219-223, 2006.
[50]
N. Almarimi, A. Ouni, M. Chouchen, I. Saidani, and M.W. Mkaouer, On the detection of community smells using genetic programming- based ensemble classifier chain. Proceedings of the 15th International Conference on Global Software Engineering, 2020, pp. 43-54.
[http://dx.doi.org/10.1145/3372787.3390439]