调查学生在方法级代码重构中的推理:一项出声思考研究
Investigating Student Reasoning in Method-Level Code Refactoring: A Think-Aloud Study
AI总结:
本研究通过出声思考法调查学生在方法级代码重构中的推理,识别出八种重构理由,并发现经验丰富的学生更关注质量属性,但常忽略多重职责方法等特定问题。
摘要:
编写高质量代码是软件开发中的一项基本技能。代码质量是软件质量的一个方面,涉及代码的直接可观察属性,如分解、模块化和代码流程。代码质量通常可以通过代码重构来改进——这是一种对代码进行的内部更改,不改变其可观察行为。根据ACM/IEEE-CS/AAAI计算机科学课程2023,代码重构和代码质量是软件工程教育的核心主题。然而,研究表明,学生经常编写出存在持续质量问题的代码。因此,理解学生在尝试识别和修复代码质量问题时遇到的困难至关重要。在先前的一项研究中,我们识别了学生在方法级代码重构中的若干误解。在本文中,我们展示了一项出声思考研究的结果,该研究旨在调查学生在完成方法级重构练习时的思考过程。我们使用扎根理论来识别和分类学生的推理。分析结果中,我们识别出学生给出的八种重构代码的理由,这些理由涉及代码质量问题的存在、软件质量属性的改进或代码语义。我们还分析了学生识别出的质量问题,以及这些质量问题与哪些推理相关联。我们发现,经验丰富的学生更常讨论代码质量属性,而不是指出他们在代码中看到的具体问题。在大多数情况下,学生能够消除代码质量问题。然而,他们常常忽略特定问题,例如方法具有多重职责或使用了不太合适的循环结构。
英文摘要:
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 student reasoning. 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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。