Source Code Readability, Clean Code, and Best Practices: A Case Study
International Journal of Computer Science and Engineering |
© 2022 by SSRG - IJCSE Journal |
Volume 9 Issue 4 |
Year of Publication : 2022 |
Authors : Lucas de Lima Silva, Giovani Fonseca Ravagnani Disperati, Antonio Angelo de Souza Tartaglia |
How to Cite?
Lucas de Lima Silva, Giovani Fonseca Ravagnani Disperati, Antonio Angelo de Souza Tartaglia, "Source Code Readability, Clean Code, and Best Practices: A Case Study," SSRG International Journal of Computer Science and Engineering , vol. 9, no. 4, pp. 7-13, 2022. Crossref, https://doi.org/10.14445/23488387/IJCSE-V9I4P102
Abstract:
Maintenance of a software product during its operating lifecycle is usually the most expensive part of a project, as this phase extends indefinitely. A software project that originally met a certain set of requirements will invariably change over time since the requirements themselves tend to change. Thus, one of the main challenges of Software Engineering, particularly considering the coding activity, is establishing practices that allow greater readability of source codes to keep codebases under control. Clean code, source code refactoring, automated testing, and the application of best practices - such as design patterns - are considered starting points for this. In this article, we sought to carry out a case study based on the code kata known as Gilded Rose. A questionnaire was applied to compare programmers' understanding of a code without best coding practices to understanding a refactored code using best practices. We conclude that student or intern-level programmers most beneficiated from such practices as a more readable code imposes less of a barrier to their understanding of the code itself and the functional requirements implemented by such code.
Keywords:
Clean Code, Code implementation, Design Patterns, Software Engineering.
References:
[1] Martin Fowler, Refactoring: Improving the Design of Existing Code, Boston, Usa: Addison-Wesley, 2019.
[2] Alberto S. Nunez Varela et al., “Source Code Metrics: A Systematic Mapping Study,” The Journal of Systems and Software, vol. 128, pp. 164-197, 2017.
[CrossRef] [Google Scholar] [Publisher Link]
[3] Erich Gamma et al., Design Patterns: Elements of Reusable Object-Oriented Software, 1st Edition Boston, USA: Addison-Wesley, 1995.
[4] Robert C. Martin, Clean Code a Handbook of Agile Software Craftsmanship, Pearson Education, 2009.
[Google Scholar]
[5] Robert C. Martin, Clean Architecture: A Craftsman's Guide to Software Structure and Design, London, England: Pearson, 2017.
[Google Scholar]
[6] Kent Beck, Test Driven Development: by Example, Bonton, USA: Addison-Wesley, 2003.
[Google Scholar]
[7] Hanan Qassim Jaleel, “Testing Web Applications,” SSRG International Journal of Computer Science and Engineering (SSRG-IJCSE), vol. 6, no. 12, pp. 1-9, 2019.
[CrossRef] [Publisher Link]
[8] Manas Kumar Yogi, and Godavarthy Kavya, “Novel Empirical Methods for Advance Software Engineering Research,” SSRG International Journal of Computer Science and Engineering (SSRG-IJCSE), vol. 5, no.7. pp. 14-20, 2018.
[CrossRef] [Publisher Link]
[9] Bjorn Latte, Soren Henning, and Maik Wojcieszak, “Clean Code: On the Use of Practices and Tools to Produce Maintainable Code for Long-Living,” In EMLS 2019: 6th Collaborative Workshop on Evolution and Maintenance of Long-Living Systems, pp. 96-99, 2019.
[Google Scholar] [Publisher Link]
[10] Henning Grimeland Koller, “Effects of Clean Code on Understandability: An Experiment and Analysis,” University of Oslo, 2016.
[Google Scholar] [Publisher Link]
[11] Jack Ganssle, “Tools for Clean Code,” Embedded Systems Programming, vol. 14, no. 4, pp. 177-180, 2021.
[12] S. W. Ambler et al., “One Sure Thing is Good Clean Code,” Communications of the ACM, vol. 44, no. 12, pp. 11-13, 2001.
[13] John Petersen, Ten Reasons Why Unit Testing Matters, Code Magazine, 2021. [Online]. Available: https://www.codemag.com/Article/1901071/10-Reasons-Why-Unit-Testing-Matters
[14] Paula Rachow, Sandra Schröder, and Matthias Riebisch, “Missing Clean Code Acceptance and Support in Practice-An Empirical Study,” 2018 25th Australasian Software Engineering Conference (ASWEC), 2018.
[CrossRef] [Google Scholar] [Publisher Link]
[15] Jozsef Katona, “Clean and Dirty Code Comprehension by Eye-Tracking Based on Gp3 Eye Tracker,” Acta Polytechnica Hungarica, vol.18, no. 1, pp. 79-99, 2021. [CrossRef] [Google Scholar] [Publisher Link]
[16] Jozsef Katona, “Examination of the Advantage of the Clean Code Technique by Analyzing Eye Movement Parameters,” Proceedings of ISER International Conference, vol. 25, 2022.
[Google Scholar] [Publisher Link]
[17] Tom Mens et al., “Refactoring: Current Research and Future Trends,” Electronic Notes in Theoretical Computer Science, vol. 82, no. 3, pp. 483-499, 2003. [CrossRef] [Google Scholar] [Publisher Link]
[18] T. Mens, and T. Tourwe, “A Survey of Software Refactoring,” IEEE Transactions on Software Engineering, vol. 30, no. 2, pp. 126-139, 2004.
[CrossRef] [Google Scholar] [Publisher Link]
[19] F. Simon, F. Steinbruckner, and C. Lewerentz, “Metrics Based Refactoring,” Proceedings Fifth European Conference on Software Maintenance And Reengineering, 2001.
[CrossRef] [Google Scholar] [Publisher Link]
[20] Miryung Kim, Thomas Zimmermann, and Nachiappan Nagappan, “A Field Study of Refactoring Challenges and Benefits,” Proceedings of the ACM SIGSOFT 20th International Symposium on the Foundations of Software Engineering, pp. 1-11, 2012.
[CrossRef] [Google Scholar] [Publisher Link]
[21] Guilherme Lacerda et al., “Code Smells And Refactoring: A Tertiary Systematic Review of Challenges and Observations,” Journal of Systems and Software, vol. 167, p. 110610, 2020.
[CrossRef] [Google Scholar] [Publisher Link]
[22] Eduardo Fernandes et al., “Refactoring Effect on Internal Quality Attributes: What Haven’t They Told You Yet?,” Information and Software Technology, vol. 126, p. 106347, 2020.
[CrossRef] [Google Scholar] [Publisher Link]
[23] Itir Karac, and Burak Turhan, “What Do We (Really) Know About Test-Driven Development?,” IEEE Software, vol. 35, no. 4, pp. 81-85, 2018.
[CrossRef] [Google Scholar] [Publisher Link]
[24] Ayse Tosun et al., “On the Effectiveness of Unit Tests in Test-Driven Development,” Proceedings of the 2018 International Conference on Software And System Process, pp. 113-122, 2018.
[CrossRef] [Google Scholar] [Publisher Link]
[25] Myint Myint Moe, “Comparative Study of Test-Driven Development (TDD), Behavior-Driven Development (BDD) And Acceptance Test-Driven Development (ATDD),” International Journal of Trend In Scientific Research And Development, vol. 3, no. 4, pp. 231-234, 2019.
[CrossRef] [Google Scholar] [Publisher Link]