ABSTRACT

We have been investigating the cognitive underpinnings of how programmers—novices and experts—read and write computer programs. Our approach has been to employ a cycle of constructing theory, carrying out empirical studies (Bonar & Soloway, 1983; Soloway, Bonar, & Ehrlich 1983; Soloway, Ehrlich, 1984; Soloway, Ehrlich, & Greenspan, 1982), and building and testing AI programs that embody our theory (Johnson & Soloway, 1984). In this chapter we present our current view on the knowledge and processing strategies programmers employ in attempting to comprehend computer programs. We first present an experiment that supports our claims as to the composition of an expert programmer's knowledge base. Next, we propose processing strategies that may be at work in comprehending programs. As support for these latter mechanisms, we draw on our experience in building a computer program that attempts to understand computer programs written by novices.