In the last lesson, we talked about black-box testing or functional testing,
which is the kind of testing that you perform when you just
look at the description of the software. Today we're going to cover white-box
testing, which is the kind of testing that we perform when we
open up the box. We look inside the program, and we actually
test it based on its code. And there is one basic assumption
behind the idea of white-box testing, which is a very intuitive one,
and the assumption is that executing the faulty statement is a necessary
condition for revealing a fault. In other words, if there is
a bug in the program there is no way were going to be
able to find this bug or this fault, if we don't execute
the statement that contains it. Which makes a lot of sense. As
we did for black-box testing, we're going to start by summarizing what
are the main advantages of white-box testing. The main advantage is that
it's based on the code, and as such, the quality of white-box
testing can be measured objectively. And what I mean here by objectively
is that if you think about black-box testing In many
cases, there were subjective decisions, there were had to be made
in order to define tests in a black-box fashion. In the
case of white-box testing, because everything is based on the quota,
we don't have to make such subjective decisions. And similarly, because
white-box testing is based on the code, it can be measured
automatically. So we can build tools and actually there are tools,
and there's plenty of tools, that can be measured, the level
of white-box testing can be achieved in a fully automated way.
And we're going to see some of them in the course of the
class. Another advantage of white-box testing is that it can be
used to compare test suites. So if you have two alternative sets
of tests that you can use to assess the quality of
your software, white-box testing techniques can tell you which one of these
two test suites is likely to be more effective in testing
your code. And finally, white-box testing allows for covering the coded behavior
of the software. What that means is that if there is
some mistake in the code and is not obvious by looking at
the specification of the code, white box testing might be able
to catch it, because it tries to exercise the code. There's many
different kinds of white box testing, there are control flow based
techniques, data flow based techniques, and fault based techniques. And for each
one of these family of techniques there are many variations. So
this field is very, very broad. In this lesson we will talk
about white-box testing by focusing
mainly on control-flow based testing techniques.