How well programmers comprehend programs is key to effective software
maintenance and evolution. But how exactly do programmers understand c
ode? Over the years, several code-comprehension models have been devel
oped to help researchers answer this question. Five types of tasks are
commonly associated with software maintenance and evolution: adaptive
, perfective, and corrective maintenance; reuse; and code leverage. Ea
ch type has its own set of typical activities. Some of them, such as u
nderstanding a system or problem, are common to several tasks. Code co
mprehension models describe the cognitive processes involved in these
tasks. Experiments support some, but not all of these models. The auth
ors analyze six comprehension models and their validation experiments
to determine the current state of knowledge program comprehension offe
rs. They begin by describing some common elements of cognition models.
Programmer knowledge plays a key role in the understanding process. T
he mental model-an internal,working representation of the software und
er consideration-includes both static and dynamic elements. Static ele
ments include text-structure knowledge, ''chunks,'' plans, hypotheses,
beacons, and rules of discourse. Dynamic elements include strategies,
actions, episodes, and processes. The authors compare the six models
in this light and identify a need for more experimental studies with e
xperienced software engineers working on specific maintenance tasks an
d large-scale code in state-of-the-art computing environments.