errors


Programming Error Checklist

error checklist
The error checklist is assembled over time by reviews of coding errors. A similar list could be kept for design, test and release errors.

This list is kept general so that it can span programming languages. A specific list may make more sense.

Data Reference
1. Unset variables used? 2. Subscripts within bounds? 3. Non-integer subscripts? 4. Dangling references? 5. Correct attributes when aliasing? 6. Record and structure attributes match? 7. Computing addresses of bit strings? 8. Passing bit-string arguments? 9. Structure definitions match across procedures? 10. String limits exceeded? 11. Off-by-one errors in indexing or subscripting operations?

Data Declaration
1. All variables declared? 2. Default attributes understood? 3. Arrays and strings initialized properly? 4. Correct lengths, types, and storage classes assigned? 5. Initialization consistent with storage class? 6. Any variables with similar names?

Computation
1. Computations on non-arithmetic variables? 2. Mixed-mode computations? 3. Computations on variables of different lengths? 4. Target size less than size of assigned value? 5. Intermediate result overflow or underflow? 6. Division by zero? 7. Base-2 inaccuracies? 8. Variable's value outside of meaningful range? 9. Operator precedence understood? 10. Integer divisions correct?

Comparison
1. Comparisons between inconsistent variables? 2. Mixed-mode comparisons? 3. Comparison relationships correct? 4. Boolean expressions correct? 5. Comparison and Boolean expressions mixed? 6. Comparisons of base-2 fractional values? 7. Operator precedence understood? 8. Compiler evaluation of Boolean expressions understood?

Control Flow
1. Multiway branches exceeded? 2. Will each loop terminate? 3. Will program terminate? 4. Any loop bypasses because of entry conditions? 5. Are possible loop fallthroughs correct? 6. Off-by-one iteration errors? 7. DO/END statements match? 8. Any non-exhaustive decisions?

Interfaces
1. Number of input parameters equal to number of arguments? 2. Parameter and argument attributes match? 3. Parameter and argument units system match? 4. Number of arguments transmitted to called modules equal to number of parameters? 5. Attributes of arguments transmitted to called modules equal to attributes of parameters? 6. Units system of arguments transmitted to called modules equal to units system of parameters? 7. Number, attributes, and order of arguments to built-in functions correct? 8. Any references to parameters not associated with current point of entry? 9. Input-only arguments altered? 10. Global variable definitions consistent across modules? 11. Constants passed as arguments?

Input/Output
1. File attributes correct? 2. OPEN statements correct? 3. Format specifications matches I/O statement? 4. Buffer size matches record size? 5. Files opened before use? 6. End-of-file conditions handled? 7. I/O errors handled? 8. Any textual errors in output information?

Other Checks
1. Any unreferenced variables in cross-reference listing? 2. Attribute list what was expected? 3. Any warning or informational messages? 4. Input checked for validity? 5. Missing function?

1