This chapter discusses three closely related topics. The first is program comprehension, which is about how software developers understand computer programs. The second is code inspections (or, as it is sometimes called, code review), which is a team activity in which the team members , together, review a piece of code, to find mistakes and suggest improvements. The third topic is refactoring, which is about reshaping the code to improve its readability and comprehension without changing its external (observable) behavior.
Interconnections among the three topics are clear: when the team reviews the code and suggests ways to improve it, all team members improve their understanding of the code; when the code is refactored, its readability is improved, and as a result, it becomes more comprehensible. In the discussion that follows , computer programs are approached from three perspectives that support each other: a cognitive perspective (program comprehension), a social perspective (code inspections), and a technical perspective (refactoring).