Something that we saw when we were looking at the split
program before is that if we just combine the interesting values that
we identify, we might end up with a lot of cases.
And I mentioned that we, we're going to look at some way of
addressing that problem. And this is exactly what happens in the
next step of the category partition method, in which we identify constraints
among choices. And why do we identify these constraints? We do
that to eliminate meaningless combinations of
inputs. If you remember, for example,
we had the case in which we were trying to
create a string with a size less than 0, which
doesn't make any sense. And very importantly, we also do
that to reduce the number of test cases. Because every time
we constrain one of the possible choices, we eliminate possible
test cases, so we can use it to keep under
control the number of tests that we generate. There are
three types of properties. The
pair property...if, error properties, and properties
of type single. So we're going to look at what these
properties mean, using, once more, our example of the split program.
In particular, we're going to use some of the choices that we
identified earlier. So let's look, for example, at choice 0, for
category length of the string. All we can say is that,
if the length is 0, this define a special property of
the string. And that was specified in this way by saying
that this identifies property zerovalue. So every time that we use
this choice, zerovalue is defined. At this point, we can use
this to exclude some meaningless
combinations. For instance, consider special characters.
If we have a string of length 0, which means a
string with no characters. Obviously, there
cannot be special characters. So, considering
this combination will just be a waste of time. So what
we do is that we specify next to this choice, that we
will only consider this if length is not 0. And we
do this by saying that we consider this only if not zerovalue.
So, if zerovalue is not defined. So this pair is an
example of a property...if case. Define a property and use that
property. Now let's look at a case in which we might
want to use an error property. For instance, when we look at
the category value for the input size, the choice value less
than 0 is an erroneous choice. So it's a choice that
we selected to test a possibly erroneous situation, so we can
mark this as an error property. And what that means is that
when generating a combination of choices, we will consider this only
once because we assume that we just want to test this error condition
once. Finally, the single property is a property that we use
when we want to limit the number of test cases. And it's
similar as an effect to error. It just has a different
meaning. So what we do when we use the single property is
that we're saying that this choice, we want to use in only
one combination. So don't combine it multiple times. And that, of course,
given the combinatorial nature of the problem, cuts down dramatically
the number of test cases. And we might use, for
instance, the single property for maxint, which means that we
will only have one test case in which the size is
equal to maxint. We're actually going to see a demo
on this topic so we'll have more chances of seeing how
properties work in practice and how good they are at
eliminating meaningless combinations and at reducing the number of test cases.