Equivalence partitioning & Boundary value analysis

Practically, due to time and budget considerations, it is not possible to perform exhausting testing for each set of test data, especially when there is a large pool test cases.

  • We need an easy way or special techniques that can select test cases intelligent from the pool of test-case, such that all test scenarios are covered.
  • For that, we use two techniques - Equivalence Partitioning & Boundary Value Analysis testing techniques.



In this tutorial, we will learn

What is Boundary Testing?

  • Boundary testing is the process of testing between extreme ends or boundaries between partitions' of the input values.
  • So these extreme ends like Start- End, Lower- Upper, Maximum-Minimum, Just Inside-Just Outside values are called boundary values and the testing is called "boundary testing".
  • The basic idea in boundary value testing is to select input variable values at their:

1. Minimum

2. Just above the minimum

3. A nominal value

4. Just below the maximum

5. Maximum

  • In Boundary Testing, Equivalence Class Partitioning has been a main role
  • Boundary Testing comes after the Equivalence Class Partitioning. Here we check the boundary values of ECP.

What is Equivalent Class Partitioning?

  • It is a black box technique (code is not visible to tester) which can be applied to all levels of testing like unit, integration, system, etc. In this technique, you divide the set of test condition into a partition that can be considered the same.
  • It divides the input data of software into different equivalence data classes.
  • We apply this technique, where there is a range in input field.

Example 1: Equivalence and Boundary Value

  • Let's consider the behavior of tickets in the Flight reservation application, while booking a new flight.
  • Let's consider the behavior of tickets in the Flight reservation application, while booking a new flight.

  • Ticket values 1 to 10 are considered valid & ticket is booked. While value 11 to 99 are considered invalid for reservation and error message will appear, "Only ten tickets may be ordered at one time."

Here is the test condition

  1. Any Number greater than 10 entered in the reservation column (let say 11) is considered invalid.
  2. Any Number less than 1 that is 0 or below, then it is considered invalid.
  3. Numbers 1 to 10 are considered valid
  4. Any 3 Digit Number say -100 is invalid.

We cannot test all the possible values because if done, the number of test cases will be more than 100.To address this problem, we use equivalence partitioning hypothesis where we divide the possible values of tickets into groups or sets as shown below where the system behavior can be considered the same.

The divided sets are called Equivalence Partitions or Equivalence Classes. Then we pick only one value from each partition for testing. The hypothesis behind this technique is that if one condition/value in a partition passes all others will also pass. Likewise, if one condition in a partition fails, all other conditions in that partition will fail.

Boundary Value Analysis- in Boundary Value Analysis, you test boundaries between equivalence partitions

In our earlier example instead of checking, one value for each partition you will check the values at the partitions like 0, 1, 10, 11 and so on. As you may observe, you test values at both valid and invalid boundaries. Boundary Value Analysis is also called range checking.

Equivalence partitioning and boundary value analysis are closely related and can be used together at all levels of testing.

Example 2: Equivalence and Boundary Value

Suppose a password field accepts minimum 6 characters and maximum 10 characters

That means values in all partitions should be equivalent like " 0-5, 6-10, 11-14 ".

Test Scenario #

Test Scenario Description

Expected Outcome

1

Enter 0 to 5 characters in password field

System should not accept

2

Enter 6 to 10 characters in password field

System should accept

3

Enter 11 to 14 character in password field

System should not accept

Examples Of Boundary Testing:

Input Box should accept the Number between 1 and 10

Test Scenario:

Test Scenario #

Test Scenario Description

Expected Outcome

1

Min value=1 & Max value=10

System should accept

2

Min value=0 & Max value=9

System should NOT accept

3

Min value=2 & Max value=11

System should NOT accept

4

Min value=0 & Max value=11

System should NOT accept

Why Equivalence & Boundary Analysis Testing

  1. This testing is used to reduce infinite number of test cases
  2. Very clear guidelines on determining test cases
  3. Appropriate for calculation-intensive applications with variables that represent physical quantities

Summary:

  • Boundary Analysis testing is used when practically it is impossible to test large pool of test cases individually
  • Two techniques - Equivalence Partitioning & Boundary Value Analysis testing techniques is used
  • In Equivalence Partitioning, first you divide a set of test condition into a partition that can be considered.
  • In Boundary Value Analysis you then test boundaries between equivalence partitions
  • Appropriate for calculation-intensive applications with variables that represent physical quantities

comments powered by Disqus