VCC399Y5 Lecture Notes - Lecture 6: Null Pointer, Test Harness
Document Summary
A stub is a low-level routine that is really just dummy code so that it can be called by a higher-level routine that is being tested. Loops and conditional statements should be checked to ensure that loops are executed the correct number of times and that branching is correct. If code is going to fail, it usually fails at a boundary. Check for off - by - one errors, empty input, empty output. Before and after a critical piece of code, check to see if the necessary pre- and post- conditions (value of variables, etc ). Remember a famous divide by zero error. Check the variable that could potentially lead to a divide by zero error. The uss yorktown, was a guided-missile cruiser, that was shut down, and drifted for a few hours due to a divide by zero error. Test for cases which can"t occur just in case! Test for extreme values -- negative values, huge values, etc .