一句话:通过简化任务研究学生代码审查中的比较式代码理解障碍,简化后准确率达89%,错误多为行为保持误解与浅层评估。
比较式代码理解指理解两段代码相对行为的认知活动,常见于代码审查、代码搜索和调试。已有研究发现学生在此类任务中障碍重重,准确率仅44%,但此前任务复杂度过高,可能低估了学生能力。本文在简化任务条件下重新研究该问题,针对工具、代码和比较理解三类障碍设计实验,招募125名学生完成8个不同规模与复杂度的代码变更任务。结果显示,学生识别代码行为变化的准确率提升至89%;错误主要归为两类:对行为保持的误解,以及对变更逻辑的浅层或不完整评估。研究为将代码审查引入课堂、减少障碍提供启示。
Comparative code comprehension - the cognitive activity of understanding how two pieces of code behave relative to each other - occurs during code review, code search, and debugging. Recent research revealed barriers that prevent students from effectively practicing comparative code comprehension during code review and determining whether a code change is behavior-preserving. This prior work suggests it is a difficult task for students, with an accuracy of 44%. However, the tasks in prior work had high complexity, potentially leading to artificially low success rates for students. In this work, we also study comparative code comprehension with students but with simplified tasks in an effort to reduce the previously identified barriers and set students up for high levels of success. We conjecture that simplification ensures that the failures and barriers students encounter are as foundational as possible. Specifically, we target barriers within the tool, code, and comparative comprehension categories from prior work. We conduct an empirical study with 125 students and eight tasks of varying sizes with code changes of varying complexity. We discover that with the chosen experimental setup, students could successfully recognize changes in code behavior with an accuracy of 89%. When students made mistakes, these fell into two primary categories: misunderstanding of behavior preservation and shallow or incomplete evaluation of change logic. Our results can benefit software engineering educators seeking to incorporate code review into the classroom while minimizing barriers.
@inproceedings{paperbot9186,
title = {Understanding Comparative Comprehension Barriers for Students during Code Review through Simplification},
author = {Nick Case and John-Paul Ore and Kathryn T. Stolee},
booktitle = {FSE},
year = {2025},
doi = {10.1145/3696630.3727249}
}