Constructing a Test Driver
A test driver is a program that runs test cases and collects the results. We describe three general approaches to writing test drivers. There are probably others and certainly there are many variations on what we present. We recommend one approach over the others and will develop it in detail.[6]
[6] If the behavior of the class calls for program termination as a postcondition—for example, when an implementation based on a defensive programming approach uses the assert() library function to check preconditions—then multiple test drivers might be needed or the test driver needs to support some way of running individual test cases.
Consider three ways to implement a test driver for the Velocity class. We will use C++ to ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access