Boundary Value Analysis & Equivalence Partitioning with Examples

Practically, exhaustive testing for each set of test data is not practicable owing to time and financial constraints, particularly when there is a vast pool of input combinations.

  • We need a simple method or specific approaches for intelligently selecting test cases from a pool of test cases such that all test situations are covered.

  • To do this, we employ two approaches: Equivalence Partitioning and Boundary Value Analysis testing procedures.

Software testing, which may be done manually or automatically, is essential for a bug-free program. Manual testing is the most common way for evaluating the functioning of software applications, despite the fact that automated testing saves testing time. We'll go through the most significant manual software testing approaches here.

What are the different types of software testing techniques?

Software testing techniques are a set of practices that aid in the improvement of the overall quality and effectiveness of any software development project. It aids in the development of better test cases, which are a collection of circumstances or variables that a tester uses to assess if a system under test meets requirements or functions properly. To increase the efficacy of the tests, many testing methodologies are used as part of the testing process.

Technique for Creating Black Box Tests

Black Box Test Design is a testing approach that examines the functionality of the Application Under Test (AUT) without looking at the underlying code structure, implementation details, or knowledge of the software's internal routes. This form of testing is fully based on software specifications and needs. We just test the software system's input and output in Black Box Testing, and we don't worry about the program's inner workings. We could save a lot of testing time and have strong test case coverage by adopting this strategy.

Five types of test techniques are often used −

  • Analysis of Boundary Values (BVA)

  • Partitioning by Equivalence Class

  • Decision Table Testing is a kind of testing that uses a table to make decisions.

  • Transition of State

  • Guessing Error

Only Boundary Value Analysis and Equivalence Class Partitioning are covered in depth in this article. The last three strategies will be discussed in future publications.

BVA (Boundary Value Analysis)

BVA is another Black Box Test Design Technique that is used to detect flaws at the input domain's borders (tests the behavior of a program at the input boundaries) rather than in the center. The main concept behind boundary value testing is to choose input variable values that are −

minimum, just above minimum, just below the minimum, nominal value, just below maximum, maximum, and just above maximum. That is, there are two borders for each range: the lower boundary (the start of the range) and the higher boundary (the end of the range), and the boundaries represent the start and end of each valid division. We should create test cases that put the program's functioning to the test at its limits, using values just within and beyond the limits. Stress and negative testing both include boundary value analysis.

We'll learn the following in this guide

  • What is Boundary Testing and How Does It Work?

  • What is Equivalent Class Partitioning, and how does it work?

  • Example 1 − Boundary Value and Equivalence

  • Example 2 − Boundary Value and Equivalence

  • What are the Benefits of Equivalence and Boundary Analysis Testing?

What is Boundary Testing and How Does It Work?

The technique of testing between extreme ends or borders between divisions of input data is known as boundary testing.

  • These extreme endpoints, such as Start-End, Lower-Upper, Maximum-Minimum, Just Inside-Just Outside values, are referred to as boundary values, and boundary testing is used to test them.

  • In normal boundary value testing, the main concept is to choose input variable values that are −

    • Minimum

    • Just a little over the bare minimum

    • a minimal amount of money

    • Just below the upper limit

    • Maximum

  • Equivalence Class Partitioning is useful in boundary testing.

  • After Equivalence Class Partitioning, follows Boundary Testing.

Partitioning by Equivalence

Equivalence Partitioning, also known as Equivalence Class Partitioning, is a black box testing approach that may be used at all stages of software development, including unit, integration, and system testing. Because of the minimal number of test cases, this approach divides input data units into comparable divisions that may be utilized to produce test cases, reducing the amount of time necessary for testing.

  • It splits program input data into several equivalent data types.

  • When there is a range in the input field, you may use this strategy.

Example 1 − Boundary Value and Equivalence

Consider the Order Pizza Text Box's behavior. Pizza values ranging from 1 to 10 are deemed legitimate. The message "success" is shown.

While values 11 to 99 are deemed invalid for ordering, an error notice stating "Only 10 Pizza may be ordered" will show.

The test situation is as follows −

  • Any number submitted in the Order Pizza form that is larger than 10 (let's say 11) is deemed invalid.

  • Any number that is less than 1 and is 0 or below is deemed invalid.

  • The numbers 1 to 10 are accepted as acceptable.

  • Any three-digit number, such as -100, is unusable.

We can't test all of the potential values since it would result in more than 100 test cases. To solve this issue, we use the equivalence partitioning hypothesis, which divides the potential values of tickets into groups or sets, as illustrated below, where the system behavior is similar.

Equivalence Partitions or Equivalence Classes are the split sets. Then, for testing, we choose just one value from each split. This approach is based on the idea that if one condition/value in a partition passes, all others will as well. Similarly, if one condition in a partition fails, the partition's other criteria will also fail.

Boundary Value Analysis (BVA) is a technique for determining the boundaries between equivalence partitions

Instead of testing one value for each partition in our previous equivalency partitioning example, you will check the values at the partitions like 0, 1, 10, 11, and so on. You test values at both valid and invalid limits, as you can see. Range checking is another name for boundary value analysis.

Boundary value analysis (BVA) and equivalence partitioning are closely connected and may be utilized jointly at all levels of testing.

Example 2: Boundary Value and Equivalence

The password box below allows a minimum of 6 and a maximum of 10 characters.

As a consequence, the findings for partitions 0-5, 6-10, 11-14 should be comparable.

Test Scenario #Test Scenario DescriptionExpected Outcome
1In the password area, type 0 to 5 charactersthe system should not accept anything else.
2Fill in the password area with 6 to 10 charactersthe system should allow
3In the password area, type 11 to 14 charactersthe system should reject it

Example 3: The Number 1 to 10 should be accepted in the input box.

The Boundary Value Test Cases may be found here.

Boundary Value = 0 - System should not allow

1 is the boundary value - Acceptance by the system is required.

2 is the boundary value - Acceptance by the system is required.

9 is the boundary value - Acceptance by the system is required.

10 is the boundary value - Acceptance by the system is required.

11 is the boundary value - It is not acceptable for the system to accept

What are the advantages of using Boundary Value Analysis?

Consider the following scenario: a developer creates code for an amount text field that only accepts and transfers numbers between 100 and 5000. The test engineer double-checks it by typing 99 into the amount text box and pressing the transfer button. Because the boundary values are already set to 100 and 5000, it will display an error notice that 99 is an incorrect test case. The text form will not transfer the amount since 99 is less than 100.

Below is a collection of both valid and invalid test scenarios.

Test Cases That Work

  • Enter 100, which is the minimum value.

  • Enter the value 101, which is the minimum value plus one.

  • Enter the number 4999, which is the maximum possible value.

  • Enter the value 5000, which is the highest possible value.

Unreliable Test Cases

  • Enter 99, which is the minimum value.

  • Enter the amount 5001, which is the maximum value plus one.

What are the Benefits of Equivalence and Boundary Analysis Testing?

  • This kind of testing is used to break down a huge number of test cases into smaller, more manageable portions.

  • Very explicit criteria for choosing test scenarios that do not jeopardize testing effectiveness.

  • Appropriate for applications that need a lot of calculations and have a lot of variables/inputs.

Equivalence Partitioning is divided into two sections

1. Pressman Rule − If the input consists of a range of numbers, create test cases for one valid and two incorrect values.

If the input consists of a collection of values, provide test cases for all legal value sets as well as two incorrect values.

Consider the following scenario −

Consider any online shopping website, where each product should be identified by a unique ID and name. Users may search for products using either the product name or the product ID. You may look at a list of items with product IDs and see whether any of them are Laptops (valid value).

Create test cases for both true and false values if the input is Boolean. Consider the following example web page, which has text fields for first name, last name, and email address, as well as radio buttons for gender that employ Boolean inputs.

The relevant value should be set as the input if the user clicks on any of the radio buttons. If the user selects a different choice, the input value must be changed to reflect the new selection (and the previously selected option should be deselected).

When a radio button option is selected, it is considered as TRUE, and when none is selected, it is treated as FALSE. Furthermore, two radio buttons should not be chosen at the same time; if they do, this is considered a problem.

2. Method of Practice − Divide the range of values into comparable portions for all of the valid values while also ensuring that two incorrect values are tested.


When it is virtually hard to evaluate a huge pool of test cases separately, boundary analysis testing is performed. The methods employed include boundary value analysis and equivalence partitioning testing.

First, you separate a collection of test conditions into a partition that may be examined in Equivalence Partitioning.

The borders between equivalence divisions are next tested using Boundary Value Analysis.

Appropriate for applications that need a lot of calculations and include variables that reflect physical quantities.