Code Review Comprehension: Reviewing Strategies Seen Through Code Comprehension Theories

📅 2025-03-27
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This study investigates the cognitive mechanisms underlying experienced reviewers’ comprehension of code changes during real-world code reviews. Method: Grounded in Letovsky’s theory of program comprehension, we conducted a qualitative study employing theory-driven thematic analysis, on-site observations, and semi-structured interviews. Contribution/Results: We present the first domain-specific cognitive model for code review—Code Review Comprehension Model (CRCM)—which characterizes review comprehension as a three-stage process: *context construction*, *multimodal inspection*, and *mental model comparison*. Our findings empirically establish code comprehension as the foundational cognitive activity in effective review, identify reusable, evidence-based review strategies, and provide actionable design implications for review tooling—including context augmentation and mental model visualization—to enhance feedback quality and review efficiency. This work marks the first rigorous application of program comprehension theory to empirical code review practice.

Technology Category

Application Category

📝 Abstract
Despite the popularity and importance of modern code review, the understanding of the cognitive processes that enable reviewers to analyze code and provide meaningful feedback is lacking. To address this gap, we observed and interviewed ten experienced reviewers while they performed 25 code reviews from their review queue. Since comprehending code changes is essential to perform code review and the primary challenge for reviewers, we focused our analysis on this cognitive process. Using Letovsky's model of code comprehension, we performed a theory-driven thematic analysis to investigate how reviewers apply code comprehension to navigate changes and provide feedback. Our findings confirm that code comprehension is fundamental to code review. We extend Letovsky's model to propose the Code Review Comprehension Model and demonstrate that code review, like code comprehension, relies on opportunistic strategies. These strategies typically begin with a context-building phase, followed by code inspection involving code reading, testing, and discussion management. To interpret and evaluate the proposed change, reviewers construct a mental model of the change as an extension of their understanding of the overall software system and contrast mental representations of expected and ideal solutions against the actual implementation. Based on our findings, we discuss how review tools and practices can better support reviewers in employing their strategies and in forming understanding. Data and material: https://doi.org/10.5281/zenodo.14748996
Problem

Research questions and friction points this paper is trying to address.

Understanding cognitive processes in code review
Extending code comprehension model for reviews
Improving tools to support reviewer strategies
Innovation

Methods, ideas, or system contributions that make the work stand out.

Observed experienced reviewers performing code reviews
Applied Letovsky's model for code comprehension analysis
Proposed Code Review Comprehension Model extension