Models for Comprehension of a Software Program

image credit:
“To walk through a program…” / Image:


Program Comprehension during Software Maintenance and Evolution

Armeliese von Mayrhauser, A. Marie Vans
Colorado State University

The paper aims to provide in-depth analysis of most notable program cognition models as well detailed comparison among them. The authors also introduce Integrated Metamodel to eventually improve the process of software maintenance and evolution. It identifies 5 fundamental tasks associated with software maintenance and evolution – Adaptive, Perfective and Corrective Maintenance; Code Reuse, and Code Leverage. The common activities among these tasks, such as Knowledge, Formulation of Mental Model are devised for better understanding of comprehension. The static elements of mental models formed by programmers include Plans, Chunks, and Text-Structure; and Dynamic elements of the mental model such as Cross Referencing are introduced. The most commonly known cognition models, which have been developed to understand cognition process behind the 5 fundamental tasks, are discussed thoroughly. They are Letovsky, Shneiderman and Mayer, Brooks, Soloway-Adelson-Ehrlich Models. The Integrated Metamodel, which seems the ideal for incorporating both top-down and bottom-up comprehension, is based on cognitive elements that also appear in models proposed by Pennington and Soloway, Adelson, and Ehrlich’s models. The authors emphasize on more research in related areas to aid comprehension of relatively larger-scale code or software systems. By understanding how programmers understand code is critical for building better tools, processes and guidelines to support the cognitive process of program comprehension.


Cognitive Design Elements to Support the Construction of a Mental Model during Software Exploration

M.-A.D. Storey, F.D. Fracchia, H.A. Muller


The paper is an attempt to analyze in detail the most commonly known cognitive models for program comprehension and suggests important cognitive design elements that should be considered when building software comprehension tools. It introduces several techniques such as reverse engineering, which uses information exploration as the key factor to gradually understand a higher-level abstraction of the program structure. It signifies coherence in visualizing programs and discusses use of tools for program visualization. The tools are classified based on factors such as program scope, interaction type, content types that can be visualized. A framework, which is based on cognitive design elements, is used by the authors to evaluate a tool called SHriMP. In the document, Top-Down and Bottom-Up Comprehensions, Knowledge based Understanding, Systematic and As-Needed Models are models discussed in details. However, there are factors that influence comprehension independent of those models, such as program size, complexity and very importantly, experience. To build a better exploration tool, a set of cognitive design elements for software exploration are analyzed for several tools. Some challenges regarding these tools are – establishing semantic and syntactic relations between software objects, providing abstraction mechanism. The ideal interface of such a tool has been analyzed by conducting user stories on SHriMP. The results of the experiment call for further research.


1. Support of a combination of top down and bottom up seems most suitable method of comprehension, since there are different kinds of programmers and in my opinion no one actually follows either one of them, but a combination of both.
2. The tree structure of the cognitive design elements is very helpful as it enables visualization in a hierarchical structure and provides a big picture.
3. Very good analysis of various program comprehension tools in use today on the basis of seven cognitive design elements. It can serve as a guide to anyone who wants to try such tools.


With due respect to authors, here are several weaknesses that may be considered-

1. Less emphasis on experience, which in my opinion is a major factor. Experience should be regarded as one of the factors and it would be great to read about experiments on SHriMP users of varying programming experience.
2. Although the different cognitive models are discussed in details, some amount of concrete mathematical data to support the theories would help to classify those theories according to correctness.
3. What is to be done to achieve semantic and syntactic relations is mentioned but not how to achieve it. But authors opinion on how would be helpful.