The Way of the Psychologist
The most dangerous error is failure to recognize our own tendency to error.
B. H. Liddell Hart
This chapter views finding defects from the perspective of cognitive psy-
chology. The first section explains the worldview of the psychologist. It
suggests that psychology is about modeling human behavior and that the
mindset of the psychologist can be applied to the process of preventing
and detecting bugs.
The second section of this chapter summarizes the approach of cognitive
psychologists to the issues of how humans make errors. It begins with com-
mon distinctions between errors occurring during the cognitive stages of
planning, storage, and execution. It then explains more sophisticated mod-
els, which distinguish errors as skill-based, rule-based, and knowledge-based.
The third section of this chapter reviews experimental research on pro-
grammers doing debugging. It presents the published research in terms of
experiment subjects, programming language used, program size, defect type,
experimental procedures, and conclusions.
Worldview of the psychologist
When we follow the way of the psychologist, we recognize that software
defects are the result of human error. Human error has relatively recently
become an area of study for cognitive psychologists.
There are two major contributing factors in the study of human error
by psychologists. First, in the 1970s and 1980s, a number of cognitive

Get Debugging by Thinking now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.