0% found this document useful (0 votes)
27 views10 pages

Boundary Value Analysis &equivalence Partitioning-Unit I

.

Uploaded by

Madhavan K
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views10 pages

Boundary Value Analysis &equivalence Partitioning-Unit I

.

Uploaded by

Madhavan K
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Boundary Value Analysis

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 likely
to yield defects.
It checks for the input values near the boundary that have a higher
chance of error. Every partition has its maximum and minimum
values and these maximum and minimum values are the boundary
values of a partition.
In simple terms boundary value Analysis is like testing the edge cases
of our software where most of the time it will get broke so it is
important to do BVA before deploying the code.
Note:
 A boundary value for a valid partition is a valid boundary value.
 A boundary value for an invalid partition is an invalid boundary
value.
 For each variable we check-
o Minimum value.
o Just above the minimum.
o Nominal Value.
o Just below Max value.
o Max value.
Example: Consider a system that accepts ages from 18 to 56.
Boundary Value Analysis(Age accepts 18 to 56)

Invalid
Valid Invalid
(min-
(min, min + 1, nominal, max – 1, max) (max + 1)
1)

17 18, 19, 37, 55, 56 57

Valid Test cases: Valid test cases for the above can be any value
entered greater than 17 and less than 57.
 Enter the value- 18.
 Enter the value- 19.
 Enter the value- 37.
 Enter the value- 55.
 Enter the value- 56.
Invalid Testcases: When any value less than 18 and greater than 56 is
entered.
 Enter the value- 17.
 Enter the value- 57.
Single Fault Assumption: When more than one variable for the same
application is checked then one can use a single fault assumption.
Holding all but one variable to the extreme value and allowing the
remaining variable to take the extreme value. For n variable to be
checked:
Maximum of 4n+1 test cases
Problem: Consider a Program for determining the Previous Date.
Input: Day, Month, Year with valid ranges as-
1 ≤ Month≤12
1 ≤ Day ≤31
1900 ≤ Year ≤ 2000
Design Boundary Value Test Cases.
Solution: Taking the year as a Single Fault Assumption i.e. year will be
having values varying from 1900 to 2000 and others will have
nominal values.

Test
Cases Month Day Year Output

1 6 15 1900 14 June 1900

2 6 15 1901 14 June 1901

3 6 15 1960 14 June 1960

4 6 15 1999 14 June 1999

5 6 15 2000 14 June 2000

Taking Day as Single Fault Assumption i.e. Day will be having values
varying from 1 to 31 and others will have nominal values.

Test Case Month Day Year Output

6 6 1 1960 31 May 1960

7 6 1 1960 1 June 1960


Test Case Month Day Year Output

8 6 29 1960 29 June 1960

9 6 32 1960 Invalid day

Taking Month as Single Fault Assumption i.e. Month will be having


values varying from 1 to 12 and others will have nominal values.

Da
Test Case Month y Year Output

10 1 14 1960 14 Jan 1960

11 2 14 1960 14 Feb 1960

12 11 14 1960 14 Nov 1960

13 12 14 1960 14 Dec 1960

For the n variable to be checked Maximum of 4n + 1 test case will be


required. Therefore, for n = 3, the maximum test cases are-
4 × 3 + 1 =13
The focus of BVA: BVA focuses on the input variable of the function.
Let’s define two variables X1 and X2, where X1 lies between a and b
and X2 lies between c and d.
Showing legitimate domain
The idea and motivation behind BVA are that errors tend to occur
near the extremes of the variables. The defect on the boundary value
can be the result of countless possibilities.
Limitation of Boundary Value Analysis:
 It works well when the product is under test.
 It cannot consider the nature of the functional dependencies of
variables.
 BVA is quite rudimentary.(Basic functionalities)
Equivalence Partitioning
It is a type of black-box testing that can be applied to all levels
of software testing . In this technique, input data are divided into the
equivalent partitions that can be used to derive test cases-
 In this input data are divided into different equivalence data
classes.
 It is applied when there is a range of input values.
Example: Below is the example to combine Equivalence Partitioning
and Boundary Value.
Consider a field that accepts a minimum of 6 characters and a
maximum of 10 characters. Then the partition of the test cases
ranges 0 – 5, 6 – 10, 11 – 14.

Test Scenario Test Description Expected Outcome

1 Enter value 0 to 5 character Not accepted

2 Enter 6 to 10 character Accepted

3 Enter 11 to 14 character Not Accepted

Why Combine Equivalence Partitioning and Boundary Analysis


Testing: Following are some of the reasons why to combine the two
approaches:
 In this test cases are reduced into manageable chunks.
 The effectiveness of the testing is not compromised on test
cases.
 Works well with a large number of variables.
Guidelines for Equivalence Partitioning :
 If the range condition is given as an input, then one valid and
two invalid equivalence classes are defined.
 If a specific value is given as input, then one valid and two
invalid equivalence classes are defined.
 If a member of set is given as an input, then one valid and one
invalid equivalence class is defined.
 If Boolean no. is given as an input condition, then one valid and
one invalid equivalence class is defined.
Example-1:
Let us consider an example of any college admission process. There is
a college that gives admissions to students based upon their
percentage.
Consider percentage field that will accept percentage only between
50 to 90 %, more and even less than not be accepted, and application
will redirect user to an error page. If percentage entered by user is
less than 50 %or more than 90 %, that equivalence partitioning
method will show an invalid percentage. If percentage entered is
between 50 to 90 %, then equivalence partitioning method will show
valid percentage.

Example 2:
Let us consider an example of an online shopping site. In this site,
each of products has a specific product ID and product name. We can
search for product either by using name of product or by product ID.
Here, we consider search field that accepts only valid product ID or
product name.
Let us consider a set of products with product IDs and users wants to
search for Mobiles. Below is a table of some products with their
product Id.

Product Product ID

Mobiles 45

Laptops 54
Product Product ID

Pen Drives 67

Keyboard 76

Headphones 34

If the product ID entered by user is invalid then application will


redirect customer or user to error page. If product ID entered by user
is valid i.e. 45 for mobile, then equivalence partitioning method will
show a valid product ID.

Example-3 :
Let us consider an example of software application. There is function
of software application that accepts only particular number of digits,
not even greater or less than that particular number.
Consider an OTP number that contains only 6 digit number, greater
and even less than six digits will not be accepted, and the application
will redirect customer or user to error page. If password entered by
user is less or more than six characters, that equivalence partitioning
method will show an invalid OTP. If password entered is exactly six
characters, then equivalence partitioning method will show valid
OTP.

You might also like