Testing and Debugging
- A precondition is a statement that must be true before you can enter a module or segment of code
- A postcondition is a statement that is true after the module, or section of code has executed.
- These are not part of C++, but tools for debugging and testing.
- When you are developing modules, you should state pre and post conditions for each module.
- When you trace the code, you check to see that the pre and post conditions are met.
- In a walk through you attempt to check to see if the algorithm works
correctly baised on the pre/post conditions.
- The author discusses checking all modules at the same level.
- You also need to try to design a test plan that includes all
possible data classes.
- All possible combinations of good values of variables
- As well as combinations of error values.