0
6.8kviews
Explain Boundary Value analysis with the help of an example

This question appears in Mumbai University > Software Testing & Quality Assurance Subject

Marks: 5M,6M,10M

Year: Dec 2013, May 14,Dec 2014,Dec 2015

1 Answer
0
181views

Boundary Value Analysis:

  • The central idea of Boundary Value Analysis (BVA) is to select test data near the boundary of a data domain so that data both within and outside an Equivalence Class (EC) are selected.

  • It produces test inputs near the boundaries to find failures caused by incorrect implementation of the boundaries.

  • BVA is a black box testing technique. It makes use of the fact that the inputs and outputs of the component under test can be partitioned into ordered sets within identifiable boundaries.

  • Boundary value analysis is most common when checking a range of numbers.

  • Boundary conditions are predicates that apply directly on and around the boundaries of input EC’s and output EC’s

  • BVA technique is an extension and refinement of EC partitioning technique.

Guidelines for Boundary Value Analysis :

  • The guidelines below are applicable to both input conditions and output conditions which are useful in identifying high quality test cases:

    1.The EC specifies a range :

    • If an EC specifies a range of values, then construct test cases by considering the boundary points of the range and points just beyond the boundaries of the range.

    • For example, let an EC specify the range of – 10.0<= X <= 10.0. This would result in test data { -9.9,-10.0,-10.1 } and {9.9, 10.0,10.1}.

2.The EC specifies a number of values:

  • If an EC specifies a number of values, then construct test cases for the minimum and maximum value of a number.
  • In addition select a value smaller than the minimum and a value larger than the maximum value.
  • For example, let the EC specification of a student dormitory specify that a housing unit can be shared by one to four students. Test cases that include 1,4,0,5 would be developed.

3.The EC specifies an ordered set :

  • If the EC specifies an ordered set, such as a linear list, table or a sequential file, then focus attention on the first and the last elements of the set.

Example of Boundary Value Analysis :

Adjusted Gross Income :

Consider a software system that computes income tax based on Adjusted Gross Income (AGI) according to the following rules :

  1. If AGI is between \$1 and \$29,500, the tax due is 22% of AGI.
  2. If AGI is between \$29,500 and \$58,500, the tax due is 27% of AGI
  3. If AGI is between \$58,500 and \$100 billion, the tax due is 36% of AGI
  • Generate test cases to cover Each Equivalence Class :
Test case No. Test Value Expected Result Equivalence Class,being tested
TC1 \$22,000 \$ 4,840 EC1
TC2 \$46,000 \$ 12,420 EC2
TC3 \$68,000 \$ 24,480 EC3
TC4 \$ -20,000 Rejected with an,error message EC4
TC5 \$150 billion Rejected with an,error message EC5
  • Once the EC’s have been identified, the BVA technique results in test as follows for each EC. The redundant data points may be eliminated.
  1. EC1 : \$1<=AGI<=$29,500 ; This would result in values of \$1, \$0, \$-1, \$1.50 and $29,499.50, \$29,500, \$ 29,500.50 .

  2. EC2 : AGI<1 ; This would result in values of \$1, \$0, \$-1, \$-100 billion.

  3. EC3 : \$29,501 <=AGI<= $58,500 ; This would result in values of \$29,500, \$29,500.50, \$ 29,501 and \$58,499 , \$58,500 , \$58,500.50, \$58,501.

  4. EC4 : \$58,501 <=AGI<= \$100 billion ; This would result in values of \$58,500 , \$58,500.50, \$58,501 and \$100 billion,101 billion.

  5. EC5 : AGI > $100 billion; This would result in \$100 billion, \$101 billion, \$10000 billion.

Please log in to add an answer.