Design the test cases and test the program of previous date problem by using Equivalence Class testing

In this article we’ll be creating test cases for previous date problem using Equivalence Class testing. In this technique, we split input domain into two groups or partitions, valid and invalid.

You can check out the “previous date problem” program along with its tested test cases here.

First let’s identify the output domain for the previous date problem.

O1 = Previous date
O2 = Invalid date

Coming to Input domain,

I1 = {1 <= date <=31 }
I2 = {date<0 }
I3 = {date>31}
I4 = {1<= month <=12 }
I5 = {month<1 }
I6 = {month >31}
I7 = {2000<= year <=2050}
I8 = {year<2000 }
I9 = {year>2050}

In this problem, we can clearly see 2 test cases for output and 9 test cases for input are made.

Test casesDateMonthYearExpected OutputProgram OutputTest Outcome
O1156202514-6-202514-6-2025Pass
O23162025Invalid DateInvalid DatePass
I1156202514-6-202514-6-2025Pass
I2062025Invalid InputInvalid InputPass
I33262025Invalid InputInvalid InputPass
I4156202514-6-202514-6-2025Pass
I515-12025Invalid InputInvalid InputPass
I615132025Invalid InputInvalid InputPass
I7156202514-6-202514-6-2025Pass
I81561999Invalid InputInvalid InputPass
I91562051Invalid InputInvalid InputPass

Leave a Reply