From Code Smell to Clean Code: A Practical Experience in Teaching Refactoring for Software Maintenance
Abstract
Teaching future Computer Science professionals to write high-quality code is essential. This work presents an experience report on teaching code smells and code refactoring in a software maintenance class with 42 students. Four aspects were analyzed: (i) students’ perception of refactoring quality, (ii) challenges faced in identifying and correcting code smells, (iii) skills developed and benefits gained through practice, and (iv) the most commonly used techniques in code smells refactoring. The results highlight the benefits of teaching code smells refactoring and propose a practical methodology for this instruction.References
Al Dallal, J. (2013). Object-oriented class maintainability prediction using internal quality attributes. Information and Software Technology, 55(11):2028–2048.
AlOmar, E. A., AlOmar, S. A., and Mkaouer, M. W. (2023). On the use of static analysis to engage students with software quality improvement: An experience with pmd. In 2023 IEEE/ACM 45th International Conference on Software Engineering: Software Engineering Education and Training (ICSE-SEET), pages 179–191. IEEE.
Bezerra, C., Alves, V. A., Lobo, A. H., Queiroz, J. P., Lima, L., and Meirelles, P. (2024). Contributing to open-source projects in refactoring code smells: A practical experience in teaching software maintenance. In Simpósio Brasileiro de Engenharia de Software (SBES), pages 399–409. SBC.
Bryant, A. and Charmaz, K. (2010). The SAGE handbook of grounded theory. Sage publications.
Chaaban, P. C., Medeiros, R., Sousa, J. L., Rocha, M., Maia, G., Lima, I., Batista, R. D., and Rabelo, J. d. H. (2023). Codesmells? aqui não! limpando e refatorando códigos na prática: Um relato de experiência da execução do curso codesmells na prática. In Workshop sobre Educação em Computação (WEI), pages 122–132. SBC.
Chren, S., Macák, M., Rossi, B., and Buhnova, B. (2022). Evaluating code improvements in software quality course projects. In Proceedings of the 26th International Conference on Evaluation and Assessment in Software Engineering, pages 160–169.
Fowler, M. (2018). Refactoring. Addison-Wesley Professional.
Kaur, A. (2020). A systematic literature review on empirical analysis of the relationship between code smells and software quality attributes. Archives of Computational Methods in Engineering, 27(4):1267–1296.
Mäntylä, M. V. and Lassenius, C. (2006). Subjective evaluation of software evolvability using code smells: An empirical study. Empirical Software Engineering, 11:395–431.
Matturro, G., Raschetti, F., and Fontán, C. (2019). A systematic mapping study on soft skills in software engineering. J. Univers. Comput. Sci., 25(1):16–41.
Pereira dos Reis, J., Brito e Abreu, F., de Figueiredo Carneiro, G., and Anslow, C. (2022). Code smells detection and visualization: a systematic literature review. Archives of Computational Methods in Engineering, 29(1):47–94.
Rabelo, A., Maia, L. C. G., and Parreiras, F. S. (2018). Performance analysis of computer science students in programming learning. In Workshop sobre Educação em Computação (WEI). SBC.
Tan, I. and Poskitt, C. M. (2024). Fixing your own smells: Adding a mistake-based familiarisation step when teaching code refactoring. In Proceedings of the 55th ACM Technical Symposium on Computer Science Education V. 1, pages 1307–1313.
Wake, W. C. (2004). Refactoring workbook. Addison-Wesley Professional.
AlOmar, E. A., AlOmar, S. A., and Mkaouer, M. W. (2023). On the use of static analysis to engage students with software quality improvement: An experience with pmd. In 2023 IEEE/ACM 45th International Conference on Software Engineering: Software Engineering Education and Training (ICSE-SEET), pages 179–191. IEEE.
Bezerra, C., Alves, V. A., Lobo, A. H., Queiroz, J. P., Lima, L., and Meirelles, P. (2024). Contributing to open-source projects in refactoring code smells: A practical experience in teaching software maintenance. In Simpósio Brasileiro de Engenharia de Software (SBES), pages 399–409. SBC.
Bryant, A. and Charmaz, K. (2010). The SAGE handbook of grounded theory. Sage publications.
Chaaban, P. C., Medeiros, R., Sousa, J. L., Rocha, M., Maia, G., Lima, I., Batista, R. D., and Rabelo, J. d. H. (2023). Codesmells? aqui não! limpando e refatorando códigos na prática: Um relato de experiência da execução do curso codesmells na prática. In Workshop sobre Educação em Computação (WEI), pages 122–132. SBC.
Chren, S., Macák, M., Rossi, B., and Buhnova, B. (2022). Evaluating code improvements in software quality course projects. In Proceedings of the 26th International Conference on Evaluation and Assessment in Software Engineering, pages 160–169.
Fowler, M. (2018). Refactoring. Addison-Wesley Professional.
Kaur, A. (2020). A systematic literature review on empirical analysis of the relationship between code smells and software quality attributes. Archives of Computational Methods in Engineering, 27(4):1267–1296.
Mäntylä, M. V. and Lassenius, C. (2006). Subjective evaluation of software evolvability using code smells: An empirical study. Empirical Software Engineering, 11:395–431.
Matturro, G., Raschetti, F., and Fontán, C. (2019). A systematic mapping study on soft skills in software engineering. J. Univers. Comput. Sci., 25(1):16–41.
Pereira dos Reis, J., Brito e Abreu, F., de Figueiredo Carneiro, G., and Anslow, C. (2022). Code smells detection and visualization: a systematic literature review. Archives of Computational Methods in Engineering, 29(1):47–94.
Rabelo, A., Maia, L. C. G., and Parreiras, F. S. (2018). Performance analysis of computer science students in programming learning. In Workshop sobre Educação em Computação (WEI). SBC.
Tan, I. and Poskitt, C. M. (2024). Fixing your own smells: Adding a mistake-based familiarisation step when teaching code refactoring. In Proceedings of the 55th ACM Technical Symposium on Computer Science Education V. 1, pages 1307–1313.
Wake, W. C. (2004). Refactoring workbook. Addison-Wesley Professional.
Published
2025-07-20
How to Cite
NASCIMENTO, João Teixeira do; SOUSA, Caio Rian R. de; LIMA, Lara Gabrielly; CARVALHO FILHO, Edivar C.; BORGES, Guilherme P.; RABELO, Jacilane H.; BEZERRA, Carla Ilane Moreira.
From Code Smell to Clean Code: A Practical Experience in Teaching Refactoring for Software Maintenance. In: WORKSHOP ON COMPUTING EDUCATION (WEI), 33. , 2025, Maceió/AL.
Anais [...].
Porto Alegre: Sociedade Brasileira de Computação,
2025
.
p. 701-711.
ISSN 2595-6175.
DOI: https://doi.org/10.5753/wei.2025.8463.
