Fixing your own smells: Adding a mistake-based familiarization step when teaching code refactoring
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...
Saved in:
Main Authors: | , |
---|---|
Format: | text |
Language: | English |
Published: |
Institutional Knowledge at Singapore Management University
2024
|
Subjects: | |
Online Access: | https://ink.library.smu.edu.sg/sis_research/8669 https://ink.library.smu.edu.sg/context/sis_research/article/9672/viewcontent/3626252.3630856.pdf |
Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
Institution: | Singapore Management University |
Language: | English |
id |
sg-smu-ink.sis_research-9672 |
---|---|
record_format |
dspace |
spelling |
sg-smu-ink.sis_research-96722024-04-02T01:36:25Z Fixing your own smells: Adding a mistake-based familiarization step when teaching code refactoring TAN, Ivan Wei Han POSKITT, Christopher M. 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 learning refactoring is easier if students are familiar with the code (having built it), that it brings refactoring closer to their regular development practice, and that it presents a powerful opportunity to learn from a 'mistake'. We designed and conducted a study with 35 novice undergraduates in which they completed various refactoring exercises alternately taught using a traditional and our 'mistake-based' approach, finding that students were significantly more effective and confident at completing exercises using the latter. 2024-03-01T08:00:00Z text application/pdf https://ink.library.smu.edu.sg/sis_research/8669 info:doi/10.1145/3626252.3630856 https://ink.library.smu.edu.sg/context/sis_research/article/9672/viewcontent/3626252.3630856.pdf http://creativecommons.org/licenses/by-nc-nd/4.0/ Research Collection School Of Computing and Information Systems eng Institutional Knowledge at Singapore Management University Refactoring code smells code quality software maintenance software engineering mistake-based learning undergraduate course Programming Languages and Compilers Software Engineering |
institution |
Singapore Management University |
building |
SMU Libraries |
continent |
Asia |
country |
Singapore Singapore |
content_provider |
SMU Libraries |
collection |
InK@SMU |
language |
English |
topic |
Refactoring code smells code quality software maintenance software engineering mistake-based learning undergraduate course Programming Languages and Compilers Software Engineering |
spellingShingle |
Refactoring code smells code quality software maintenance software engineering mistake-based learning undergraduate course Programming Languages and Compilers Software Engineering TAN, Ivan Wei Han POSKITT, Christopher M. Fixing your own smells: Adding a mistake-based familiarization step when teaching code refactoring |
description |
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 learning refactoring is easier if students are familiar with the code (having built it), that it brings refactoring closer to their regular development practice, and that it presents a powerful opportunity to learn from a 'mistake'. We designed and conducted a study with 35 novice undergraduates in which they completed various refactoring exercises alternately taught using a traditional and our 'mistake-based' approach, finding that students were significantly more effective and confident at completing exercises using the latter. |
format |
text |
author |
TAN, Ivan Wei Han POSKITT, Christopher M. |
author_facet |
TAN, Ivan Wei Han POSKITT, Christopher M. |
author_sort |
TAN, Ivan Wei Han |
title |
Fixing your own smells: Adding a mistake-based familiarization step when teaching code refactoring |
title_short |
Fixing your own smells: Adding a mistake-based familiarization step when teaching code refactoring |
title_full |
Fixing your own smells: Adding a mistake-based familiarization step when teaching code refactoring |
title_fullStr |
Fixing your own smells: Adding a mistake-based familiarization step when teaching code refactoring |
title_full_unstemmed |
Fixing your own smells: Adding a mistake-based familiarization step when teaching code refactoring |
title_sort |
fixing your own smells: adding a mistake-based familiarization step when teaching code refactoring |
publisher |
Institutional Knowledge at Singapore Management University |
publishDate |
2024 |
url |
https://ink.library.smu.edu.sg/sis_research/8669 https://ink.library.smu.edu.sg/context/sis_research/article/9672/viewcontent/3626252.3630856.pdf |
_version_ |
1795302167866769408 |