Explanations should take around 40 words. Some slack will be given to 50 or 60 word explanations (however, don't press your luck too many times on this); explanations a page or more long will lose five points.
Your colleague is apparently trying to save testing time by skipping the search for errors and looking directly for failures. Because failures are program-internal manifestations of faults, structural testing would be the appropriate method to try out your colleague's ideas.
One reason is to test the quality of the tests designed for that code. If the tests can't find any of the errors, then it's probably a good idea to reconsider the criteria and generation methods associated with the test data.
A second reason to test for known errors is that testing for a specific type of known error may reveal unknown errors of the same type. For example, testing for known buffer-overflow errors may reveal other, unknown buffer overflows.
A third reason, related to the first, is that testing for a known number of errors can provide an estimate of the latent errors remaining after testing. If the test suite found 80% of the known errors, then it would be reasonable (or at least not unreasonable) to use 20% when estimating the latent-error count.
You are looking for low coupling among modules (of whatever kind) because low coupling leads to easier testing. The lower the coupling, the greater the independence among modules. A set of relatively independent modules is easer to test than is a set of inter-dependent modules.
that returns true if playerbool winning_move(tic_tac_toe_board b, player p)
p
(either X or O) has winning move given the
board b
and false otherwise. Explain the test method and test cases you
would use (and don't forget the 40 word limit).
The key is to note that there are at most (39)*2, or around 40,000,
possible inputs to winning_move()
. This suggests that exhaustive testing
is appropriate, and because the tests would involve only inputs and outputs,
the tests would be functional.
This page last modified on 14 April 2001.