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] M. Fowler, Refactoring: Improving the Design of Existing Code, Boston, Usa: Addison-Wesley, 2019.
[2] S. N. Varela, “Source Code Metrics: A Systematic Mapping Study,” The Journal of Systems and Software. [S. L.] , pp. 128-197, 2017.
[3] E. Gamma et al, Design Patterns: Elements of Reusable Object-Oriented Software, 1st Edition Boston, USA: Addison-Wesley, 1994.
[4] R. C. Martin, Clean Code a Handbook of Agile Software Craftsmanship,Massachusetts, USA: Prentice Hall, 2009.
[5] R. C. Martin, Clean Architecture: A Craftsman's Guide to Software Structure and Design, London, England: Pearson, 2017.
[6] K. Beck, Test Driven Development: by Example, Bonton, USA: Addison-Wesley, 2002.
[7] H. Q. Jaleel, “Testing Web Applications,” SSRG International Journal of Computer Science and Engineering (SSRG-IJCSE), vol. 6, no. 12, pp. 1-9, 2019. Crossref, https://doi.org/10.14445/23488387/IJCSE-V6I12P101
[8] M. K. Yogi, G. Kavya, “Novel Empirical Methods for Advance Software Engineering Research,” SSRG International Journal of Computer Science and Engineering (SSRG-IJCSE), vol. 5, no.7. pp. 1-7, 2018. Crossref, https://doi.org/10.14445/23488387/IJCSEV5I7P103
[9] B. Latte, S. Henning, M. Wojcieszak, “Clean Code: on the Use of Practices and Tools to Produce Maintainable Code for Long-Living Software,” In EMLS 2019: 6th Collaborative Workshop on Evolution and Maintenance of Long-Living Systems, pp. 96-99, 2019.
[10] H. G. Koller, Effects of Clean Code on Understandability: An Experiment and Analysis, University of Oslo, pp. 1-100, 2016.
[11] J. G Ganssle, “Tools for Clean Code,” Embedded Systems Programming, vol. 14, no. 4, pp. 177-180, 2021.
[12] S. W. Ambler, J. Jaros, J. Highsmith, K. Guntheroth, E. A. Weiss, S. Pothier, “One Sure Thing is Good Clean Code,” Communications of the ACM, vol. 44, no. 12, pp. 11-13, 2001.
[13] J. V. Petersen, “Ten Reasons Why Unit Testing Matters,” Code Magazine, pp. 70-73, 2019.
[14] P. Rachow, S. Schröder, M. Riebisch, “Missing Clean Code Acceptance and Support in Practice-An Empirical Study,” 2018 25th Australasian Software Engineering Conference (ASWEC), pp. 131-140, 2018.
[15] J. 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.
[16] J. Katona, “Examination of the Advantage of the Clean Code Technique by Analyzing Eye Movement Parameters,” Proceedings of ISER International Conference, vol. 25, no. 26, pp. 51-54, 2022.
[17] T. Mens, S. Demeyer, B. Du Bois, H. Stenten, P Van Gorp, “Refactoring: Current Research and Future Trends,” Electronic Notes in Theoretical Computer Science, vol. 82, no. 3, pp. 483-499, 2003.
[18] T. Mens, T. Tour, “A Survey of Software Refactoring,” IEEE Transactions on Software Engineering, vol. 30, no. 2, pp. 126-139, 2004.
[19] F. Simon, F. Steinbruckner, C. Lewerentz, “Metrics Based Refactoring,” Proceedings Fifth European Conference on Software Maintenance And Reengineering. IEEE, pp. 30-38, 2001.
[20] M. Kim, T. Zimmermann, N. 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.
[21] G. Lacerda, F. Petrillo, M. Pimenta, Y. G. Guéhéneuc, “Code Smells And Refactoring: A Tertiary Systematic Review of Challenges and Observations,” Journal of Systems and Software, vol. 167, pp. 110610, 2020.
[22] E. Fernandes, A. Chávez, A. Garcia, I. Ferreira, D. Cedrim, L. Sousa, W. Oizumi, “Refactoring Effect on Internal Quality Attributes: What Haven’t They Told You Yet?” Information and Software Technology, vol. 126, pp. 106347, 2020.
[23] I. Karac, B. Turhan, “What Do We (Really) Know About Test-Driven Development?” IEEE Software, vol. 35, no. 4, pp. 81-85, 2018.
[24] A. Tosun, M. Ahmed, B. Turhan, N. Juristo, “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.
[25] M. M. 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, pp. 231-234, 2019.