Investigating Student Reasoning in Method-Level Code Refactoring: A Think-Aloud Study

Publication date

2024-11-13

Authors

Carneiro Oliveira, EduardoORCID 0009-0004-5795-5219ISNI 0000000518010087
Keuning, HiekeISNI 000000049290580X
Jeuring, J.T.ISNI 0000000110063265

Editors

Advisors

Supervisors

Document Type

Part of book
Open Access logo

License

taverne

Abstract

Producing code of good quality is an essential skill in software development. Code quality is an aspect of software quality that concerns the directly observable properties of code, such as decomposition, modularization, and code flow. Code quality can often be improved by means of code refactoring – an internal change made to code that does not alter its observable behavior. According to the ACM/IEEE-CS/AAAI Computer Science Curricula 2023, code refactoring and code quality are core topics in software engineering education. However, studies show that students often produce code with persistent quality issues. Therefore, it is important to understand what problems students experience when trying to identify and fix code quality issues. In a prior study, we identified a number of student misconceptions in method-level code refactoring. In this paper, we present the findings from a think-aloud study conducted to investigate what students think when working on method-level refactoring exercises. We use grounded theory to identify and classify students’ reasonings. As a result of the analysis, we identify a set of eight reasons given by students to refactor code, which either concerns the presence of code quality issues, the improvement of software quality attributes, or code semantics. We also analyze which quality issues are identified by students, and to which reasonings these quality issues are related. We found that experienced students reason more often about code quality attributes rather than pointing at a problem they see in the code. Students were able to remove code quality issues in most cases. However, they often overlooked particular issues, such as the presence of a method with multiple responsibilities or the use of a less suitable loop structure.

Keywords

Taverne

Citation

Carneiro de Oliveira, E, Keuning, H & Jeuring, J 2024, Investigating Student Reasoning in Method-Level Code Refactoring: A Think-Aloud Study. in Koli Calling '24 : Proceedings of the 24th Koli Calling International Conference on Computing Education Research., 8, Association for Computing Machinery. https://doi.org/10.1145/3699538.3699550