N this chapter, we will introduce you to the fundamentals of testing: why testing is



tải về 6.34 Mb.
Chế độ xem pdf
trang12/25
Chuyển đổi dữ liệu03.04.2023
Kích6.34 Mb.
#54490
1   ...   8   9   10   11   12   13   14   15   ...   25
Foundations of Software Testing ISTQB Certification 3rd ed


partition or at the
smallest incremental
distance on either side of
an edge, for example the
minimum or maximum
value of a range.
Section 3 Specification-Based or Black-Box Techniques 83


Because the boundary values are defined as those values on the edge of a
partition, we have identified the following boundary values:
–$0.01 (an invalid
boundary value because it is at the edge of an invalid partition), $0.00, $100.00,
$100.01, $999.99 and $1000.00, all valid boundary values.
So by applying boundary value analysis we will have six tests for boundary
values. Compare what our naïve tester Robbie had done: he did actually hit one of
the boundary values ($100) though it was more by accident than design. So in
addition to testing only half of the partitions, Robbie has only tested one-sixth of the
boundaries (so he will be less effective at finding any boundary defects). If we
consider all of our tests for both equivalence partitioning and boundary value
analysis, the techniques give us a total of nine tests, compared to the 16 that Robbie
had, so we are still considerably more efficient as well as being over three times
more effective (testing four partitions and six boundaries, so 10 conditions in total
compared to three).
Note that in the bank interest example, we have valid partitions next to other
valid partitions. If we were to consider an invalid boundary for the 3% interest rate,
we have
−$0.01, but what about the value just above $100.00? The value of $100.01
is not an invalid boundary; it is actually a valid boundary because it falls into a valid
partition. So the partition for 5%, for example, has no invalid boundary values
associated with partitions next to it.
A good way to represent the valid and invalid partitions and boundaries is in a
table such as Table 4.1:
By showing the values in the table, we can see that no maximum has been
specified for the 7% interest rate. We would now want to know what the maximum
value is for an account balance, so that we can test that boundary. This is called an
‘open boundary’, because one of the sides of the partition is left open, i.e. not
defined. But that doesn
’t mean we can ignore it – we should still try to test it, but
how? We have called it
‘$Max’ to remind ourselves to investigate this.
T A B L E 4 . 1
Equivalence partitions and boundaries
Test conditions
Valid partitions
Invalid partitions
Valid boundaries Invalid boundaries
Balance in
account
$0.00
– $100.00
$100.01
– $999.99
$1000.00
– $Max
< $0.00
> $Max
non-integer
(if balance is an
input field)
$0.00
$100.00
$100.01
$999.99
$1000.00
$Max
– $0.01
$Max+ 0.01
Interest rates
3%
Any other value
Not applicable
Not applicable
5%
Non-integer
7%
No interest
calculated
84
Chapter 4 Test design techniques


Open boundaries are more difficult to test, but there are ways to approach them.
Actually the best solution to the problem is to find out what the boundary should be
specified as! One approach is to go back to the specification to see if a maximum
has been stated somewhere else for a balance amount. If so, then we know what our
boundary value is. Another approach might be to investigate other related areas of
the system. For example, the field that holds the account balance figure may be only
six figures plus two decimal figures. This would give a maximum account balance
of $999 999.99 so we could use that as our maximum boundary value. If we really
cannot find anything about what this boundary should be, then we probably need to
use an intuitive or experience-based approach to probe various large values trying to
make it fail.
We could also try to find out about the lower open boundary
– what is the lowest
negative balance? Although we have omitted this from our example, setting it out
in the table shows that we have omitted it, so helps us be more thorough if we
wanted to be.
Representing the partitions and boundaries in a table such as this also makes it
easier to see whether or not you have tested each one (if that is your objective).
Extending equivalence partitioning and boundary value analysis
So far, by using EP and BVA we have identified conditions that could be tested,
i.e. partitions and boundary values. The techniques are used to identify test conditions,
which could be at a fairly high level (e.g.
‘low-interest account’) or at a detailed
level (e.g.
‘value of $100.00’). We have been looking at applying these techniques to
ranges of numbers. However, we can also apply the techniques to other things.
For example, if you are booking a flight, you have a choice of Economy/Coach,
Premium Economy, Business or First Class tickets. Each of these is an equivalence
tải về 6.34 Mb.

Chia sẻ với bạn bè của bạn:
1   ...   8   9   10   11   12   13   14   15   ...   25




Cơ sở dữ liệu được bảo vệ bởi bản quyền ©hocday.com 2024
được sử dụng cho việc quản lý

    Quê hương