Test Case Evaluation

How to we know that the output of a test is correct? One way is to calculate the values by hand and compare them to the results. Another strategy is to supply input values for which we know the correct answer. For example, in the program computing square root approximations, use as inputs 4, 100, 1/4 and 0.01. Third strategy for validating outputs is to verify they fulfill certain properties. For example, a guess for the square root squared should produce the original number if correct.
Finally, we can use of another method, which is known to compute the correct results to verify the correctness of the outputs of a test. Such method, which produces correct results, even though slower and less efficiently, is known as an oracle. Examples of two programs, one using an oracle and another verifying mathematical property of square roots are in code machines in the following workrooms.

Links:
Testing and Debugging
Validating output by property
Validating output using an oracle