Availability Guide for Application Design
Minimizing Programming Errors
Availability Guide for Application Design—525637-004
9-10
High-Level Testing
application has several drawbacks. Much of the code will probably remain untested
and is likely to contain errors. In addition, errors that are discovered by high-level tests
are hard to fix because high-level tests do not always indicate the module in which the
problem lies.
To build quality into the application, you should start by developing one small, critical
module or unit and test it thoroughly—including tests that check not only the expected
flow of control, but also all error paths and error conditions. You can then develop the
module that calls your tested module, test that module thoroughly, and so on. Thus,
incremental development and testing ultimately gives you a fully integrated application
that you know has a high level of quality because the code has gone through many
test cycles.
The way you test each unit clearly depends on what the code is supposed to do. Using
bottom-up testing, you would write a driver for the module that not only tests the
specified function of the module, but also exercises the logic paths within it. If the
module accepts a range of values, for example, you would at least test the upper
range, lower range, and some intermediate value. You might also test values outside
the range to make sure that they are rejected. If the module contains an algorithm,
then you should try it out with various combinations of inputs and verify that the results
are as specified.
Formal inspections of code, or other formal review processes, can also help build in
quality at this level. “Checklist for Common Errors,” earlier in this section, provides a
starting point for an inspections checklist. By visually inspecting code against a list of
common errors, a team of qualified inspectors will find additional coding errors.
High-Level Testing
The final step of unit testing performs an integration test that tests the entire application
against the application design specifications. Once these tests are done and the code
is considered to be of high quality, you start running a series of higher level tests to
make sure that the application not only satisfies the design specification, but also
achieves the objectives specified in the requirements documentation.
Having placed emphasis on inspection and testing early in the development phase, the
remaining higher-level tests will find fewer errors and will, therefore, need less time to
execute.
Of the many suites of high-level tests that you might design and choose to run,
NonStop testing and power-fail testing are of specific interest to applications that run
on HP NonStop systems. These tests apply to characteristics of your application that
reflect the unique availability features of HP NonStop systems.
NonStop Testing
Applications are often at their most vulnerable while recovering from a failure. You
need to make sure that your application behaves as anticipated if failures occur. To
determine that this is true, you should design and run a series of tests that ensure: