Testing a validation program

This example will take the validation program (Listing 4.2) and apply the black box method of testing. Recall that the purpose of this program was to validate the week sales range of data for each sales representative on the weeklysales worksheet of the SALESMAN w orkbook. In this example, data input into each cell had to be numeric, and in the range 0 to 100.

To use the b lack b ox method of testing, we first need to decide on ranges for selecting appropriate data. As a starting point, we could consider the input of non-numeric data, such as an alphabetic character. If such a v alue is input into a cell in the range week_sales then we would expect an error message. We could choose an arbitrary character value to test, e.g. 'r'.

If numeric data is input, then there are a number of ranges to consider. Consider first the v alid range 0-100, we can choose an arbitrary value in this range, e.g. 44. We also need to choose the boundary points which are 0 and 100, because both these points are valid data points. Then, we need to consider invalid numeric data, e.g. values <0 or >100. Again, if we take arbitrary values like -7 and 3454. This will give 6 tests in total.

Table 8.1 The test plan for the validate program

Test Number

Value of Cell chosen

Predicted Result

1

Error message and cell colour change

2

44

No change

3

0

No change

4

100

No change

5

-7

Error message and cell colour change

6

3454

Error message and cell colour change

The next step is to produce the test log (Table 8.2). If we analyse it, we can see that there is a problem with Test Number 4 - all other tests are OK at this stage. In the next section we will discuss how to set about fixing errors.

Table 8.2 The test log for the validate program

Test No

Date

Predicted Result

Actual Result

1

18 Nov 02

Error message & cell colour change

Error message & cell colour change

2

18 Nov 02

No change

No change

3

19 Nov 02

No change

No change

4

21 Nov 02

No change

Error message & cell colour change

5

22 Nov 02

Error message & cell colour change

Error message & cell colour change

6

22 Nov 02

Error message & cell colour change

Error message & cell colour change

0 0

Post a comment