So let's talk more about testing, as we said a
little earlier in the lesson, testing means executing the program on
a sample of the input domain, that is of all
the possible input data and I really want to stress that
this sample is tiny sample of the input domain. There
are two important aspects of testing that I'm want to mention here,
there first one is that testing is a dynamic technique. And
what that means is that the program must be executed in
order to perform testing. The second important point is that
testing is an optimistic approximation. And what does it mean
to be optimistic? Well, it means that the program under
test is exercised with a very small subset of all the
possible inputs as we just said. And this is done
under the assumption that the behavior with any other input
is consistent with the behavior shown for the selected subset
of input data, that is why it is an optimistic approach.
Another concept that I want to mention explicitly, is the
concept of successful test. And I'm going to do that,
using another quote. This one from Goodenough and Gerhart
in their paper Towards a Theory of Test Data Selection,
and what the quote says is that a test
is successful if the program fails. And this might sound
counterintuitive, but the point here is that testing cannot
prove the absence of errors, but only reveal their presence.
If a set of tests does not produce any failure, we are either in the extremely
unlikely case of a correct program, or in
the very likely situation of a bad set of
tests that are not able to reveal failures of the program. And that is why we
say that the test is successful if you
can show that there are problems in the program.