1 of 34

Boundary Value Analysis

Based on the fact that input values near the boundary have higher chances of errors.

2 of 34

Boundary Value Analysis

  • Values lying on the boundary
  • Values just above lower boundary
  • Values just below the upper boundary.

3 of 34

Boundary Value Analysis

When the function F is implemented as a program of two input variables, the input variables x1 and x2 will have some boundaries:

a ≤ x1 ≤ b

c ≤ x2 ≤ d

The intervals [a, b] and [c, d] are referred to as the ranges of x1 and x2, (instead of domain) so we have overloaded the term.

4 of 34

Domain of a function of two variables

5 of 34

Boundary value analysis focuses on the boundary of the input space to identify test cases.

The basis behind boundary value testing is that errors tend to occur near the extreme values of an input variable.

6 of 34

Boundary Value Analysis

Single Fault Assumption : Holding the value of the all but one variable at their nominal value (assumed correct) and letting that variable assume extreme value.

Ex: (x, y) – 1 to 10

Test cases for x Test cases for y

(1,5)

(2,5)

(9,5)

(10,5)

7 of 34

The basic idea of boundary value analysis is to use input variable values at their minimum, just above the minimum, a normal value, just below their maximum, and their maximum.

A commercially available testing tool (originally named T) generates such tests cases for a properly specified program.

8 of 34

9 of 34

Generalizing boundary value analysis

The basic boundary value analysis technique can be generalized in two ways:

By the number of variables and the kinds of ranges.

Generalizing the number of variables is easy. If we have a function of n variables, we hold all but one at the normal values and let the remaining variable assume the Min, min+, nom, max-, and max values, repeating this for each variable.

Thus, for a function of n variables, boundary value analysis yields 4n+1 unique test cases.

There are 4*2+1=9 unique test cases.

10 of 34

Boundary value analysis (2 Variables)

11 of 34

Limitations of Boundary value analysis

Boundary value analysis works well when the program is a function of several independent variables that represent bounded physical quantities.

.

12 of 34

Boundary value analysis assumes the variables to be truly on independent. Even so boundary value analysis happens to catch end-of-month and end-of-year faults. Boundary value analysis test cases are derived from the extreme of bounded, independent variables that refer to physical quantities, with no consideration of the nature of the function, or of the semantic meaning of the variable.

.

13 of 34

When a variable refers to a physical quantity, such as temperature, pressure, air speed, angle of attack, load and so forth, physical boundaries can be extremely important.

14 of 34

Advantages of BVA:

a) Very good at exposing potential user interface/user input problems

b) Very clear guide lines on determining test cases

c) Very small set of test cases generated

Disadvantages of BVA:

a) Does not test all possible inputs

b) Does not test dependencies between combinations of inputs

15 of 34

Robustness Testing

Robustness testing is a simple extension of boundary value Analysis. Here we add min- and max+ values as additions.

The boundary value analysis applies directly to robustness testing, especially the generalizations and limitations. The most interesting part of the robustness testing is not with the inputs, but with the expected outputs.

The main value of robustness testing is that it forces attention on exception handling.

16 of 34

Robustness Testing (2 Variables)

17 of 34

Worst Case Testing

Boundary value analysis makes a single fault assumption of reliability theory.

Rejecting single fault assumption, we are interested in what happens when more than one variable has an extreme value. This is called worst case analysis.

For each variable, we start with the five elements set that contain the min, min+, nom, max-, and max values.

We then take the Cartesian product of the sets to generate test cases. Worst – case testing for a function of n variables generates 5n test cases.

In this case 52= 5*5= 25 test cases

18 of 34

Worst case Testing (2 Variables)

19 of 34

Robust Worst-case Testing

  • Worst-case testing follows the generalization pattern of boundary value analysis.

• It also has the same limitations, particularly those related to independence.

• The best application for worst-case testing is where physical variables have numerous interactions and where failure of the function is extremely costly.

• For really paranoid testing, we do robust worst- case testing. This involves Cartesian product of the seven - elements sets we used in robustness testing resulting in 7n test cases.

• Here we have 72=7*7=49 test cases

20 of 34

Robust Worst-case Testing (2 Variables)

21 of 34

�Special value testing �

Special value testing is the most widely practiced form of functional testing.

• It is the most intuitive with similar programs, and information’s about “soft sports” to device test cases. We might also call this adhoc testing or “seat-of-the- pants” testing.

• No guidelines are used other than to use “best engineering judgment”. As a result, special value testing is very dependent on the abilities of the tester.

22 of 34

If an interested tester defines special value test cases for NextDate, we would see several test cases involving February 28, February 29 and leap years. Even though special value testing is highly subjective, it often results in a set of test cases that is more effective in revealing faults than the test cases generated by the other methods of software testing.

23 of 34

Test Cases for the Triangle Problem

  • Table below contains Boundary Value Analysis Test Cases using 1-200 range. We have noticed that case 3, 8, 13 are identical, so two should be deleted.

24 of 34

Random Testing

Here, the idea is to generate random number to pick test cases rather than always choosing min, min+, nom, max-, max values.

The values for a bounded variable a ≤ x ≤ b as follows:

x=Int ((b-a+1) * Rnd+a)

Int: returns integer, Rnd: generates random numbers in the interval [0, 1]

The program keeps generating random test cases until at least one of each output occurs.

25 of 34

Equivalence Class Testing

The important aspect of equivalence classes is that they form a partition of a set, where partition refers to collection of mutually disjoint subsets, the union of which is the entire set.

• This law has two important implications for testing:

The fact that the entire set is represented provides a form of completeness, and the disjointedness relation

• The elements of a subset have something in common. The idea of equivalence class testing is to identify test cases by using one element from each equivalence class.

26 of 34

The key point in equivalence class testing is to choose the equivalence relation that determines the classes.

• We need the function that we have used in boundary value testing for the sake of comprehensible drawings, which relates to a function F of two variables x1 and x2.

27 of 34

When F is implemented as a program, the input variables x1 and x2 will have the following boundaries, and intervals within the boundaries:

a≤ x1≤d, with intervals [a, b) , [b, c) , [c, d]

e≤ x2≤g, with intervals [e, f), [f, g]

• Where square brackets and parentheses denote, respectively, closed and open interval endpoints. The intervals presumably correspond to some distinction in the program being tested.

28 of 34

Decision Table – Based Testing

Decision tables have been used to represent and analyze complex logical relationships. They are ideal for describing situations in which a number of combinations of action are taken under varying sets of conditions.

A decision Table has four portions: the left- most columns is the stub portion; to the right is the entry portion. The condition portion is noticed by c’s, action portion is noted as a’s. They are referred as condition stub, condition entries, action stub, and action entries.

29 of 34

When we have binary conditions (true/false, yes/no, 0/1), the condition portion of a decision tables is truth table that has been rotated 900 . This structure guarantees that we consider every possible combination of condition values.� Rules indicate which action, if any, are taken for the circumstances (pre-conditions) indicated in the condition portion of the rule.�

30 of 34

We use decision tables for test case identification; this completeness property of a decision table guarantees a form of complete testing.�

31 of 34

Decision Table – Based Testing

Every decision table consists of 4 parts:

    • Condition STUB
    • Action STUB
    • Condition ENTRIES
    • Action ENTRIES

32 of 34

Stub

Rule1

Rule2

Rule3,4

Rule5

Rule6

Rule7,8

C1

T

T

T

F

F

F

C2

T

T

F

T

T

F

C3

T

F

-

T

F

-

a1

X

X

 

X

 

 

a2

X

 

 

 

X

 

a3

 

X

 

X

 

 

a4

 

 

X

 

 

X

33 of 34

 

R1

R2

R3

R4

R5

R6

R7

R8

R9

C1:a,b,c form a triangle

F

T

T

T

T

T

T

T

T

C2: a=b?

-

T

T

T

T

F

F

F

F

C3: a=c?

-

T

T

F

F

T

T

F

F

C4: b=c?

-

T

F

T

F

T

F

T

F

A1: Not a Triangle

X

 

 

 

 

 

 

 

 

A2:Scalene

 

 

 

 

 

 

 

 

X

A3: Isosceles

 

 

 

 

X

 

X

X

 

A4: Equilateral

 

X

 

 

 

 

 

 

 

A5:Impossible

 

 

X

X

 

X

 

 

 

34 of 34

Decision tables are declarative that conditions and actions follow no particular order.