How to perform equivalence class partitioning
Software testing involves several testing techniques, including black-box testing.
Equivalence class partitioning (ECP) is a technique which allows us to perform black-box testing in a software product. We can apply ECP to unit testing, integration, system testing, and more.
How to perform ECP
In ECP, we divide the input data into valid and invalid values to check whether or not they exhibit the same behavior.
We divide the input into classes of data that help us derive test cases. This division demonstrates a partition, and each partition equivalates over a class of data.
Let’s observe an example to see how ECP works.
Example
Suppose there is a “search an item” feature on an online store. We can test the behavior of this feature by giving several valid and invalid inputs.
Valid test case
Suppose we want to search for an item “Laptop.” The expected result is that the test case succeeds and the item is displayed.
Invalid test case
The text box only approves data written in text form. If the user enters data in numeric form, the test case does not succeed and the application gives an error.
Suppose the expected result and actual results are the same. We can then say that the test case has successfully run and the feature is good to go.
Free Resources