ICPC 2025
Sun 27 - Mon 28 April 2025 Ottawa, Ontario, Canada
co-located with ICSE 2025

Despite the popularity and importance of modern code review, there is limited understanding of the cognitive processes that enable reviewers to analyze code and provide meaningful feedback. 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, demonstrating 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. 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 to interpret and evaluate the proposed changes. 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://zenodo.org/records/14049621