Boundary Value Analysis-3

5.0 Applying Boundary Value Analysis
In the general application of Boundary Value Analysis can be done in a uniform manner. The basic form of implementation is to maintain all but one of the variables at their nominal (normal or average) values and allowing the remaining variable to take on its extreme values. The values used to test the extremities are: 

• Min ------------------------------------ - Minimal 
• Min+ ------------------------------------ - Just above Minimal 
• Nom ------------------------------------ - Average 
• Max- ------------------------------------ - Just below Maximum 
• Max ------------------------------------ - Maximum 

In continuing our example this results in the following test cases shown in figures 5.1 and 

You maybe wondering why it is we are only concerned with one of the values taking on their extreme values at any one particular time. The reason for this is that generally Boundary Value Analysis uses the Critical Fault Assumption. There are advantages and shortcomings of this method. The advantages will be discussed in chapter 5.2, and alternative methods will be shown in chapter 7.

5.1 Some Important examples
To be able to demonstrate or explain the  need for certain methods and their relative merits I will introduce two testing examples proposed by P.C. Jorgensen [1]. These examples will provide more extensive ranges to show where certain testing techniques are required and provide a better overview of the methods usability. 

• The NextDate problem 
The NextDate problem is a function of three variables: day, month and year. Upon the input of a certain date it returns the date of the day after that of the input. 
The input variables have the obvious conditions: 
1 ≤ Day ≤ 31. 
1 ≤ month ≤ 12. 
1812 ≤ Year ≤ 2012.  
(Here the year has been restricted so that test cases are not too large). 

There are more complicated issues to consider due to the dependencies between variables. For example there is never a 31st of April no matter what year we are in. The nature of these dependencies is the reason this example is so useful to us. All errors in the NextDate problem are denoted by “Invalid Input Date.” 

• The Triangle problem 
In fact the first introduction of the Triangle problem is in 1973, Gruenburger. There have been many more references to this problem since making this one of the most popular example to be used in conjunction with testing literature.
The triangle problem accepts three integers (a, b and c)as its input, each of which are taken to be sides of a triangle. The values of these inputs are used to determine the type of the triangle (Equilateral, Isosceles, Scalene or not a triangle). 

For the inputs to be declared as being a triangle they must satisfy the six conditions: 
C1. 1 ≤ a ≤ 200. 
C2. 1 ≤ b ≤ 200. 
C3. 1 ≤ c ≤ 200. 

C4. a < b + c. 
C5. b < a + c. 
C6. c < a + b. 
Otherwise this is declared not to be a triangle. 

The type of the triangle, provided the conditions are met, is determined as follows: 
1. If all three sides are equal, the output is Equilateral. 
2. If exactly one pair of sides is equal, the output is Isosceles.  
3. If no pair of sides is equal, the output is Scalene.

No comments: