Availability Guide for Application Design
Minimizing Programming Errors
Availability Guide for Application Design—525637-004
9-4
Checklist for Common Errors
2. Missing operations
These problems include operations that should have been performed but were not.
For example, pointers and other variables were not initialized, data was not
updated, interprocess communication was missing.
3. Data errors
These errors result in an incorrect constant or variable used within the program.
4. Incorrect procedure interfaces
The calling module supplied an incorrect parameter or wrongly interpreted a
returned parameter.
5. Memory allocation and deallocation errors
These errors include using memory that has been deallocated (for example,
through a dangling pointer), or using memory that was incorrectly allocated.
6. Data definition errors
These errors occur when a program has an incorrect data definition for a piece of
shared data.
7. Incorrect computations
These errors are caused by using the wrong algorithm or by using an incorrectly
coded algorithm.
This subsection provides some guidelines on how to design quality into your code to
protect your application from these kinds of errors. It provides you with checklists that
help you:
•
Visually inspect code to look for common causes of these problems
•
Determine where to insert error detectors that will respond if unexpected error
conditions occur
Additional problems can be caused by factors outside the application developer’s
control. Detection of these types of errors is not considered to be the responsibility of
the application developer. These problems are the responsibility of the resources in
which they occur.
Checklist for Common Errors
The following checklist indicates the most common coding errors that cause software
faults on HP NonStop systems. You can add to this checklist and use it as a basis for
formal inspection of your code.
•
Are pointers properly initialized depending on the language, and how the pointer is
used?
•
Are local variables initialized at their declaration?