EDUCBA

EDUCBA

MENUMENU
  • Blog
  • Free Courses
  • All Courses
  • All in One Bundle
  • Login
Home Software Development Software Development Tutorials Software Testing Tutorial Equivalence Partitioning

Equivalence Partitioning

By Aanchal SinghAanchal Singh

Equivalence Partitioning

Introduction to Equivalence Partitioning

Equivalence partitioning is a black box test design technique in which test cases are designed to execute representatives from equivalence partitions. It can be applied to any level of the software testing, designed to divide a sets of test conditions into the groups or sets that can be considered the same i.e. system should handle them equivalently. Equivalence partitioning is also known as equivalence classes.

How does Equivalence Partitioning Work?

This testing involved testing only for one condition for every partition which is created. The reason for this is that we consider that all conditions in one partition should be treated the same by the software. This is because we have an assumption that if one condition works for the partition, it will work for other conditions as well. This leaves us with saving our efforts in the testing. If a particular condition does not work, then it can be concluded that the other conditions will also not work and there is no point left in testing the other conditions in that partition. The partitions which are created can be created for valid data i.e for the values which can be accepted and also for invalid data which means values which are to be rejected. One representative value is chosen in the partition and it covers all the items in the same partition that can be considered. A set of data is to be chosen which can act as input condition. The result when the program is executed can classify as a set of equivalent data for that entire partition.

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

Examples of Equivalence Partitioning

Let us have a look at a few examples which will give us an idea on how the equivalence partitioning works.

Example #1

  •  Test cases for input box accepting alphabets from A to Z by using Equivalence Partitioning.

The test case should have all valid inputs for this partition. By this, we mean that pick nay alphabet between A to Z. If any other alphabet is chosen between these 26 alphabets the output will give us the same results. Hence we can conclude that one input is sufficient for testing this condition.

  • Input data other than these alphabets account as invalid input. These inputs can be either numerical values or special characters.

By this, you can categorize and segregate all possible test cases which can be divided into three classes. Values in test cases other than the selected ones from any class should give the same result. There is one representative selected from every input class which helps us in designing the test cases. The test case values are selected in such a way that the largest number of values should be tested and the same results should be received for all test cases present in a class, This can be either for valid values or invalid values.

Example #2

A text field supports only numeric characters and their length should be 6 to 10 characters long. For this condition, there can be three partitions or classes which can be created. The first partition where numeric values are present having a length between 6 to 10. This is a valid condition. The second partition where numeric values are present but they have the length as 0 to 5. This is an invalid condition. The third partition having numeric values having a length from 11 to 14. This also is an invalid condition. While evaluating these partitions we can take cases from each of these partitions and test for all test cases present in these partitions. If we check one condition from each of these partitions all cases would be tested for each partition.

Example #3

Similar to previous examples, we can check data for decimal places as well. We can assume that we are considering either zero decimal places or more than two decimal places. When test cases are to be designed for this application, it should be ensured that all three partitions are covered. The invalid partition should be tested at least once. We can choose to calculate interest on the amount of Rs. -10.00, Rs. 50.00, Rs. 280 and Rs. 1354.00. If these were not mentioned specifically it is a possibility that one of them could be missed due to testing another several time. The partitioning can also be applied to outputs as well.

Importance of Equivalence Testing

Below are the important points for Equivalence Testing:

  • Equivalence Testing is one of the effective ways of preparing test cases. It is a type of black-box testing which mainly focuses on testing the functionality of the software. Doing equivalence testing reduces the number of test cases. Also, it does not compromise on the test coverage of the software.
  • The quality is not compromised, and effort is reduced due to partitions that are created. It is important as it saves time and one can work effortlessly on the generic test cases created for the partitions or classes. It is important for test cases that have a huge number of test cases and it is exhausting to test these.
  • It also ensures the test coverage which needs to be maintained and taken care of. Once the test cases are created for valid and invalid inputs they can be tested, and the partitions will have similar results.

Conclusion

Equivalence Partitioning is a way in which data is partitioned and divided for efficient testing. The divided sets are known as partitions or classes. Dividing the data makes it easy to test and also reduces the number of test cases. This method increases the overall coverage of testing and ensures that black box testing is done in an effortless and efficient manner. Equivalence Partitioning is thus fast and if one condition in a partition passes then all conditions for that condition will be passed. Similarly, if one condition fails then collectively it will be failed for the entire partition. This technique can be used at all levels of testing and it can be ensured that a large number of test cases can be covered by dividing them into chunks.

Recommended Articles

This is a guide to Equivalence Partitioning. Here we discuss an introduction to Equivalence Partitioning, how does it work, with its examples and important. You can also go through our other related articles to learn more –

  1. Negative Testing
  2. What is Automated Testing?
  3. Selenium Load Testing
  4. Risk Based Testing
All in One Excel VBA Bundle
500+ Hours of HD Videos
15 Learning Paths
120+ Courses
Verifiable Certificate of Completion
Lifetime Access
Financial Analyst Masters Training Program
1000+ Hours of HD Videos
43 Learning Paths
250+ Courses
Verifiable Certificate of Completion
Lifetime Access
All in One Data Science Bundle
1500+ Hour of HD Videos
80 Learning Paths
360+ Courses
Verifiable Certificate of Completion
Lifetime Access
All in One Software Development Bundle
3000+ Hours of HD Videos
149 Learning Paths
600+ Courses
Verifiable Certificate of Completion
Lifetime Access
Primary Sidebar
All in One Software Development Bundle3000+ Hours of HD Videos | 149 Learning Paths | 600+ Courses | Verifiable Certificate of Completion | Lifetime Access
Financial Analyst Masters Training Program1000+ Hours of HD Videos | 43 Learning Paths | 250+ Courses | Verifiable Certificate of Completion | Lifetime Access
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Java Tutorials
  • Python Tutorials
  • All Tutorials
Certification Courses
  • All Courses
  • Software Development Course - All in One Bundle
  • Become a Python Developer
  • Java Course
  • Become a Selenium Automation Tester
  • Become an IoT Developer
  • ASP.NET Course
  • VB.NET Course
  • PHP Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2023 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you
Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more