Testing and Verification

Overview

A system that cannot be trusted to work correctly has no value. This means that the programs must function correctly and there must be a way to determine that the results that come back are valid and complete. Writing the code with the ability to fully test itself solves the first problem and makes coding easier in the process.

Testing

Every code module in Cosm function has a corresponding function that is designed to test the functions of the module. This involves calling every function in ways that will cause all possible results to occur. Any boundary values should be tested, and all error codes should be triggered by causing conflicts. In other words, do everything possible to make it break during testing.

When any Cosm program is run, this self-test should be run to verify that everything is working as it should. Without this testing, the results generated may not be trusted.

This extensive self-testing also makes porting and debugging of the code far simpler. Once the code compiles, any operational errors will be revealed during the testing.

This extensive testing also serves another purpose, the test code also serves as a complete example of how to use all the functions, and how to handle the results. The header files specify how the functions work, but it is often easier and clearer to look at an example of the function in use.

v0.01 by Adam L. Beberg


© Mithral Inc. 1995-2024. All Rights Reserved.
Mithral® and Cosm® are trademarks of Mithral Inc.