Software Testing Techniques - Equivalence Partition
This technique divides input data into data classes to reduce test cases amount to validate a rule. The idea is that given a set of possible equivalent values, using just one of those values will be enough to design a test case.
An advantage of this approach is reduction in the time required for testing a software due to lesser number of test cases.
It strives to find errors that may arise based on information classes and reduce to the minimum the effort needed in terms of test case design as well as test data mass.
The user will input credentials (email and password).
If credentials are valid, redirect to home page. Show an error message otherwise.
How to apply technique:
You can have a huge valid list of emails that could be used:
As well as a huge list of invalid emails
- [email protected]
For passwords, you can have:
- a valid password for a specific and valid user
- non-valid password (one that does not exists on the system)
Equivalence Partition means that any element on a given individual set should be enough to design a test case.
For represent an invalid email we can choose xxx123
Same logic applies to password
Shipping fee based on zipcode
An e-commerce have a shipping rule based on zipcodes. All shipping to California is eligible to free shipping. All other west cost are US$ 10.00 and The rest of USA is US$ 20.00
How to apply technique
We all know there are lots of zipcodes by state, and we are not going to use them all. For this case, we need:
- One valid zipcode in California
- One valid zipcode in West Coast, other than California
- One valid zipcode in outside west coast
- One invalid zipcode *
Thus, we reduce from thousands of zipcodes to only 4. A lot better now.
Despite it is not outlined in the rule, I have put the 4th one, the invalid zipcode.
This is because this is the most important test: testing the spec itself. In this case, thinking about dividing data into categories, we found a class that is not in the spec, and has no behaviour or expectations clearly set. I then include this class here and ask for partners/stakeholders/business analysts, what should be the behaviour for this case and then amend the spec or I can review and rip off this data class from my tests.