You are here

Find and correct errors

7 September, 2015 - 12:26

When you have executed a test, review the output, either by examining the results of a program to compare the expected v. the actual results, or by scanning the results yourself. A discrepancy between the two may have one of the three following causes:

  • The discrepancy is only apparent: the results are just in a slightly different format (such as a zero being unsigned in one and signed in the other). Correct the expected results so that the discrepancy does not repeat, wasting time every time the test is rerun.
  • The discrepancy may stem form an error in the test data. This occurs quite frequently. The expected result itself may be wrong; there may be a clerical error in the test data; or the test data may not correspond to the intent of the test case. In the first two instances, the error is easily corrected. In the third case, it may be a little more complex, because the problem is a sign that the program specification may have been misunderstood.
  • The discrepancy is due to an error in the program. In that case, correct the program and rerun the test. You must also make sure that the correction has not disturbed a part of the program that has already been tested, if necessary by rerunning all previously run test cycles. This process is called regression testing. In practice, you do not run a complete regression test every time you find a small error in your program – you can postpone it until the end. However, before you can hand off the program to the next phase, you need to rerun all the test cycles once after all your corrections have been completed.