Fixing Your Own Smells: Adding a Mistake-Based Familiarisation Step When Teaching Code Refactoring
Ivan Tan, Christopher M. Poskitt

TL;DR
This paper introduces a mistake-based learning approach for teaching code refactoring, where students first create code with intentional smells, helping them better understand and apply refactoring techniques.
Contribution
It proposes a novel teaching method that leverages students' own mistakes to improve understanding and application of code refactoring practices.
Findings
Students were more effective in refactoring exercises with the new approach.
Students reported higher confidence when using the mistake-based method.
The approach led to better internalization of refactoring concepts.
Abstract
Programming problems can be solved in a multitude of functionally correct ways, but the quality of these solutions (e.g. readability, maintainability) can vary immensely. When code quality is poor, symptoms emerge in the form of 'code smells', which are specific negative characteristics (e.g. duplicate code) that can be resolved by applying refactoring patterns. Many undergraduate computing curricula train students on this software engineering practice, often doing so via exercises on unfamiliar instructor-provided code. Our observation, however, is that this makes it harder for novices to internalise refactoring as part of their own development practices. In this paper, we propose a new approach to teaching refactoring, in which students must first complete a programming exercise constrained to ensure they will produce a code smell. This simple intervention is based on the idea that…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software Engineering Techniques and Practices · Software Reliability and Analysis Research
