Previous | Next | Table of Contents | Index | Program List | Copyright

6.9 Tricks of the Trade: Testing with Exception Handling

Ada's exception handling provides a powerful tool for designing programs whose behavior is predictable even if its inputs are badly formed or out of range. If exception handling were not available, it would be the programmer's responsibility to validate all incoming data--for example, by checking its range with an IF statement. Indeed, Ada programs can certainly be written this way--with no use of exception handling--but the result would not take advantage of this built-in power.

Even if exception handling is used to advantage, however, the programmer still has several important responsibilities in this area:

In summary, Ada's exception handling provides a useful way to take account of unusual circumstances in your program but does not relieve you of the responsibility to design and test carefully so that your program's behavior will always be predictable.


Previous | Next | Table of Contents | Index | Program List | Copyright

Copyright © 1996 by Addison-Wesley Publishing Company, Inc.