Arunkumar Khannur's Software Testing Knowledge Center
   
 

9.3. Boundary Value Analysis

When we try to test the functionality of the system, we basically consider input domain: where in we consider the input values to be supplied to test the system; and outputs produced by the system shall be compared with expected results.

Boundary Value Analysis (BVA) technique is test case design technique that allows to identify appropriate number of input values to be supplied to test the system.

Human brain is evolved in emotional side and less evolved in logical side. Hence during software development, people always get confused in using < and <=; > and >= relational operators. As such large number of errors tends to occur at boundaries of the input domain. BVA leads to selection of test cases that exercise boundary values. BVA complements equivalence partitioning. Rather than select any element in an equivalence class, select those at the ''edge'' of the class. BVA based test case design helps to write test cases that exercise bounding values.

9.3.1. Using BVA- Range
When the programming element is a range type, we can arrive at test cases using BVA as follows:
For a range of values bounded by a and b, then test:
  • (Minimum Value-precision)
  • Minimum Value
  • (Minimum Value+ precision),
  • (Maximum Value- precision)
  • Maximum Value
  • (Maximum Value + precision)

9.3.2. Using BVA- Value
When the programming element is a value type, we can arrive at test cases using BVA as follows:
  • If input conditions specify a number n, then test with:(n- precision) n and (n+ precision)
  • If internal program data structures have boundaries (e.g., buffer size, table limits), then use input data to exercise structures on boundaries.

9.3.3. Illustration
Write Test Cases using BVA for a requirement that is stated as follows:
“If the examination grading system, if the student scores 0 to less than 40 then assign E Grade, if the student scores between 40 to 49 then assign D Grade, if the student scores between 50 to 69 then assign C Grade, if the student scores between 70 to 84 then assign B Grade, and if the student scores 85 to 100 then assign A Grade.”

In the above problem definition, after analysis, we identify following Boundary Values:
0 to 39
40 to 49
50 to 69
70 to 84
85 to 100

Based on BVA, we identify following input values to test each boundary:
For Boundary Values in range 0 to 39:

For 0 to 39 boundary values, Minimum Value= 0, Maximum Value = 39, Precision is 1. Thus, input values for testing for this boundary values are: (Minimum Value-precision)= -1
Minimum Value= 0
(Minimum Value+ precision)= 1
(Maximum Value- precision)= 38
Maximum Value= 39
(Maximum Value + precision)= 40

Thus, input values for Boundary Values 0 and 39 are:
-1, 0, 1, 38, 39, 40.
On the similar lines of analysis, we arrive at following input values for other Boundary values:

For 40 to 49, we have 39, 40, 41, 48, 49, 50
For 50 to 69, we have 49, 50, 51, 58, 59, 60
For 70 to 84, we have 69, 70, 71, 83, 84, 85
For 85 to 100, we have 84, 85, 86, 99, 100, 101

For these boundaries, test cases based on BVA technique are documented in Table 9.1 Test Case Design for a given example using BVA Technique
Table 9.1 Test Case Design for a given example using BVA Technique
 
Khannur's Book
Arunkumar Khannur, Software Testing - Techniques and Applications, Published by Pearson Publications, 2011 (ISBN:978-81-317-5836-6; Pages:341 + xxii)
Follow Khannur
         
Khannur's Company
ISQT Process & Consulting Services Pvt. Ltd., Bangalore, INDIA
Khannur's Software Testing Forum
STEP-AUTO Forum
 Contact Khannur
ISQT Process & Consulting Services Pvt. Ltd.
#732, 1st Floor, 12th Main,
3rd Block, Rajajinagar,
Bangalore - 560010, INDIA
Phone: +91 80 23012511
URL: www.isqtinternational.com
Email: khannur@isqtinternational.com
Skype: arun.isqt