Site icon TestingDocs.com

Equivalence Class Partitioning

Overview

In this tutorial, we will learn about Equivalence Class Partitioning. In the approach, the domain of test input values to a software application is partitioned into a set of equivalence classes. This partitioning is done such that the application’s behavior under test(AUT) is similar for every input data belonging to the same equivalence class.

Equivalence Class Partitioning

Equivalence Class Partitioning(ECP) is a software testing technique that divides the input test data of the AUT(Application Under Test) into a set of equivalence classes. An equivalence class represents a set of valid or invalid states for the input values/conditions.

Equivalence Classes are derived from the system specifications like user requirements, user stories, etc. Equivalence Classes provide logical partitioning of the input test data. Each partition has at least one of equivalent data from which test cases can be derived.

Creating Equivalence Classes

The main idea behind defining the equivalence classes is that testing the code with any value belonging to an equivalence class is as good as testing the application with any other value belonging to that equivalence class partition.

For example, Consider a web page with an input field that accepts numbers.
The specification for the field is: the field is supposed to accept a number from 1 to 100; the equivalence class partitions are as follows:

Valid Equivalence Class partition:

For example, Any number in [1, 100]
27

Invalid Equivalence Class partitions:

For example: -5

For example: 160

Example

Let’s look at another example: Consider an input field that allows an input number for the student’s age. We can assume values from 0 to 100 for the age data field. The three equivalence classes are as follows:

The test cases must include representatives for each of the three equivalence classes. A range of values can specify the input data values to a system, then one valid and two invalid equivalence classes should be defined. The possible equivalence class test cases can be:   {-5,15,200}

The ECP technique is used in black box testing to minimize the number of test cases while maintaining adequate test coverage.

More Information

https://en.wikipedia.org/wiki/Black-box_testing

 

Exit mobile version