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

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

In triangle problem, we require to identify output and input domain.

Output Domain:

O1 = Not a triangle, when any of the sides is greater than the sum of the other
O2 = Equilateral Triangle
O3 = Isosceles Triangle
O4 = Scalene Triangle

Input Domain:
I1 = { 0< a <= 10 }
I2 = { a<0 }
I3 = { a>10 }
I4 = { 0< b <= 10 }
I5= { b<0 }
I6 = { b>10 }
I7 = { 0< c <= 10 }
I8 = { c<0 }
I9 = { c>10 }

Further, on the basis of sides equality and whether the sum of the two sides are equal or greater, we can create classes.
I10 = { a=b=c }
I11 = { a=b, b!=c }
I12 = { b=c, c!=a }
I13 = { a=c, c!=b }
I14 = { a!=b!=c }
I15 = { a+b = c }
I16 = { a+b < c }
I17 = { b+c = a }
I18 = { b+c < a }
I19 = { c+a = b }
I20 = { c+a >b }
There are 4 possible outcomes and 20 possible input classes, in total 24 test cases to test.

Here are the test cases and program tested results.

ClassesabcExpected OutputProgram OutputTested Outcome
O11055Not a TriangleNot a TrianglePass
O2555Equilateral TriangleEquilateral TrianglePass
O3155Isosceles TriangleIsosceles TrianglePass
O41095Scalene TriangleScalene TrianglePass
I1555Equilateral TriangleEquilateral TrianglePass
I2055Invalid InputInvalid InputPass
I31155Invalid InputInvalid InputPass
I4555Equilateral TriangleEquilateral TrianglePass
I5505Invalid InputInvalid InputPass
I65115Invalid InputInvalid InputPass
I7555Equilateral TriangleEquilateral TrianglePass
I8550Invalid InputInvalid InputPass
I95511Invalid Input
.
Invalid InputPass
I10555Equilateral TriangleEquilateral TrianglePass
I11551Isosceles TriangleIsosceles TrianglePass
I12155Isosceles TriangleIsosceles TrianglePass
I13515Isosceles TriangleIsosceles TrianglePass
I149510Scalene TriangleScalene TrianglePass
I155510Not a TriangleNot a TrianglePass
I161510Not a TriangleNot a TrianglePass
I171055Not a TriangleNot a TrianglePass
I181051Not a TriangleNot a TrianglePass
I195105Not a TriangleNot a TrianglePass
I205101Not a TriangleNot a TrianglePass

Leave a Reply