The Art of Software Testing, Second Edition
by Glenford J. Myers, Corey Sandler, Tom Badgett, Todd M. Thomas
3.3. An Error Checklist for Inspections
An important part of the inspection process is the use of a checklist to examine the program for common errors. Unfortunately, some checklists concentrate more on issues of style than on errors (for example, "Are comments accurate and meaningful?" and "Are if-else, code blocks, and do-while groups aligned?"), and the error checks are too nebulous to be useful (such as "Does the code meet the design requirements?"). The checklist in this section was compiled after many years of study of software errors. The checklist is largely language independent, meaning that most of the errors can occur with any programming language. You may wish to supplement this list with errors peculiar to your programming language and with errors detected after using the inspection process.
3.3.1. Data Reference Errors
Does a referenced variable have a value that is unset or uninitialized? This probably is the most frequent programming error; it occurs in a wide variety of circumstances. For each reference to a data item (variable, array element, field in a structure), attempt to "prove" informally that the item has a value at that point.
For all array references, is each subscript value within the defined bounds of the corresponding dimension?
For all array references, does each subscript have an integer value? This is not necessarily an error in all languages, but it is a dangerous practice.
For all references through pointer or reference variables, is the referenced ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access