What is a Boundary Value
A boundary value is any input or output value on the edge of an equivalence partition. Boundary Value Analysis is based on testing the boundary values of valid and invalid partitions. The behavior at the edge of the equivalence partition is more likely to be incorrect than the behavior within the partition, so boundaries are an area where testing is expected to yield defects.
Boundary value checks for the input values near the boundary with a higher chance of error. Every partition has its maximum and minimum values, for example, if you have a text box which accept numbers in range of 1-10 then 1 is minimum boundary value and 10 is maximum boundary value for this valid partition.
Why Equivalence & Boundary Analysis Testing
- This testing is used to reduce many test cases to manageable chunks.
- Obvious guidelines on determining test cases without compromising on the effectiveness of testing.
- Appropriate for calculation-intensive applications with a large number of variables/inputs.
Let us take an example to explain this:
Suppose you have a software which accepts values between 1-1000, so the valid partition will be (1-1000), equivalence partitions will be like:
|Invalid Partition||Valid Partition||Invalid Partition|
|0||1-1000||1001 and above|
And the boundary values will be 1, 1000 from valid partition and 0,1001 from invalid partitions.
Boundary Value Analysis is a black box test design technique where test case are designed by using boundary values, BVA is used in range checking.
A store in city offers different discounts depending on the purchases made by the individual. In order to test the software that calculates the discounts, we can identify the ranges of purchase values that earn the different discounts.
For example, if a purchase is in the range of $1 up to $50 has no discounts, a purchase over $50 and up to $200 has a 5% discount, and purchases of $201 and up to $500 have a 10% discounts, and purchases of $501 and above have a 15% discounts.
We can identify 4 valid equivalence partitions and 1 invalid partition as shown below.
|Invalid Partition||Valid Partition(No Discounts)||Valid Partition(5%)||Valid Partition(10%)||Valid Partition(15%)|
From this table we can identify the boundary values of each partition. We assume that two decimal digits are allowed.
- Boundary values for Invalid partition: 0.00
- Boundary values for valid partition(No Discounts): 1, 50
- Boundary values for valid partition(5% Discount): 51, 200
- Boundary values for valid partition(10% Discount): 201,500
- Boundary values for valid partition(15% Discount): 501, Max allowed number in the software application
Summary of Boundary Value Analysis:
It is used when it is impossible to test a large pool of test cases individually. Two techniques – Boundary value analysis and equivalence partitioning testing techniques are used together.
In Equivalence Partitioning, first, you divide a set of test conditions into a partition that can be considered.
In BVA, you then test boundaries between equivalence partitions. This is appropriate for calculation-intensive applications with variables that represent physical quantities