Fixing Your Own Smells: Adding a Mistake-Based Familiarisation Step When Teaching Code Refactoring

被引:1
作者
Tan, Ivan [1 ]
Poskitt, Christopher M. [1 ]
机构
[1] Singapore Management Univ, Singapore, Singapore
来源
PROCEEDINGS OF THE 55TH ACM TECHNICAL SYMPOSIUM ON COMPUTER SCIENCE EDUCATION, SIGCSE 2024, VOL. 1 | 2024年
关键词
Refactoring; code smells; code quality; software maintenance; software engineering; mistake-based learning; undergraduate course;
D O I
10.1145/3626252.3630856
中图分类号
G40 [教育学];
学科分类号
040101 ; 120403 ;
摘要
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.
引用
收藏
页码:1307 / 1313
页数:7
相关论文
共 29 条
[1]   Reflections on Teaching Refactoring: A Tale of Two Projects [J].
Abid, Shamsa ;
Basit, Hamid Abdul ;
Arshad, Naveed .
ITICSE'15: PROCEEDINGS OF THE 2015 ACM CONFERENCE ON INNOVATION AND TECHNOLOGY IN COMPUTER SCIENCE EDUCATION, 2015, :225-230
[2]  
[Anonymous], 2018, Refactoring: improving the design of existing code
[3]  
[Anonymous], 2023, Refactoring: clean your code
[4]  
Bezerra C., 2022, AN 10 WORKSH VIS EV, P41
[5]   Hyperstyle: A Tool for Assessing the Code Quality of Solutions to Programming Assignments [J].
Birillo, Anastasiia ;
Vlasov, Ilya ;
Burylov, Artyom ;
Selishchev, Vitalii ;
Goncharov, Artyom ;
Tikhomirova, Elena ;
Vyahhi, Nikolay ;
Bryksin, Timofey .
PROCEEDINGS OF THE 53RD ACM TECHNICAL SYMPOSIUM ON COMPUTER SCIENCE EDUCATION (SIGCSE 2022), VOL 1, 2022, :307-313
[7]   "I know it when I see it" - Perceptions of Code Quality [J].
Borstler, Jurgen ;
Stoerrle, Harald ;
Toll, Daniel ;
van Assema, Jelle ;
Duran, Rodrigo ;
Hooshangi, Sara ;
Jeuring, Johan ;
Keuning, Hieke ;
Kleiner, Carsten ;
MacKellar, Bonnie .
ITICSE'17: PROCEEDINGS OF THE 2017 ACM CONFERENCE ON INNOVATION AND TECHNOLOGY IN COMPUTER SCIENCE EDUCATION, 2017, :389-389
[8]   Code Quality Defects Across Introductory Programming Topics [J].
Effenberger, Tomas ;
Pelanek, Radek .
PROCEEDINGS OF THE 53RD ACM TECHNICAL SYMPOSIUM ON COMPUTER SCIENCE EDUCATION (SIGCSE 2022), VOL 1, 2022, :941-947
[9]   A Review-based Comparative Study of Bad Smell Detection Tools [J].
Fernandes, Eduardo ;
Oliveira, Johnatan ;
Vale, Gustavo ;
Paiva, Thanis ;
Figueiredo, Eduardo .
PROCEEDINGS OF THE 20TH INTERNATIONAL CONFERENCE ON EVALUATION AND ASSESSMENT IN SOFTWARE ENGINEERING 2016 (EASE '16), 2016,
[10]  
Ginat D, 2008, SIGCSE'08: PROCEEDINGS OF THE 39TH ACM TECHNICAL SYMPOSIUM ON COMPUTER SCIENCE EDUCATION, P26, DOI 10.1145/1352322.1352148