Izu, C.Mirolo, C.Monga, M.Lonati, V.Barendsen, E.Sheard, J.Paterson, J.2024-08-022024-08-022024Annual Conference on Innovation and Technology in Computer Science Education, ITiCSE, 2024 / Monga, M., Lonati, V., Barendsen, E., Sheard, J., Paterson, J. (ed./s), vol.1, pp.73-79979-8-4007-0600-41942-647Xhttps://hdl.handle.net/2440/141757Whilst most undergraduate students eventually produce functionally correct code, they often disregard their code style and overall quality when it is not graded. As reported by the literature, quality defects affect both code structure and code style, and these issues seem to persist even in later years. This paper reports on the potential of a low-cost intervention that directed CS2 students to revise and refactor their code, with a specific focus on code structure, by resorting to a range of online refactoring resources. A “refactor-your-working-solution” assignment received 73 submissions by 47 students. For each cleaned solution, students were required to provide a one-page report documenting their improvements step-by-step, and include a short reflection on their learning. Their efforts to clean code and their reflections are analysed in this experience report. Most students were able to apply multiple refactoring steps as well as other editing steps to improve their code style. In particular, we have identified a wide range of code smells in their code, hence gaining insights on their success in locating and removing 90% of them. Additionally, students’ reflections appear to indicate an increased awareness as to the importance of readability and the need to develop more consistent habits when planning, coding and documenting their software.en© 2024 Copyright held by the owner/author(s). Publication rights licensed to ACMCS2; code quality; readability; refactoringAsking Students to Refactor their Code: A Simple and Valuable ExerciseConference paper10.1145/3649217.36535462024-07-15699577Izu, C. [0000-0002-7492-8886]