Next: Techniques for detecting errors
Up: Unit 10
Previous: Errors detected by the
Drivers for testing are program portions that are used to test the correctness
of a class or of a method. The purpose of such drivers is to call all methods
of the public interface of a class and verify that they respect the
specification.
In order to perform a test that is complete, we should follow some guidelines:
- verify each functionality (each method);
- perform the tests according to a specific order (the order of method
application is often important);
- ensure that each statement is executed at least once (for example, when
we have a conditional statement, we have to perform the test for various
configurations of the input, in such a way that the boolean condition becomes
respectively true and false);
- detect and test special cases (for example, an empty file as input to a
method that reads from a file).
Next: Techniques for detecting errors
Up: Unit 10
Previous: Errors detected by the