testing Software Testing Techniques - Equivalence Partition Shipping fee based on zipcode

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!


The Rule

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:

  1. One valid zipcode in California
  2. One valid zipcode in West Coast, other than California
  3. One valid zipcode in outside west coast
  4. 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.

Got any testing Question?