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

In Equivalence class testing, we require to separate valid input and output domain from invalid inputs and outputs. And then after test cases are formed.

Program:

Here are the Quadratic Equation problem program and its tested outputs.

Equivalence Class testing

Considering Output domain first,

O1 = Not a quadratic equation when a = 0
O2 = Real roots,  b2 – 4ac > 0
O3 = Equal roots,  b2 – 4ac = 0
O4 = Imaginary roots,  b2 – 4ac < 0
Now 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 }
I10 = { a= 0 }
In total there are 14 test cases, 4 for possible outputs and 10 for different different combinations of input.

Input and output domainsabcExpected OutputProgram OutputTested Outcome
O1055Not QuadraticNot QuadraticPass
O2155RealRealPass
O3555ImaginaryImaginaryPass
O45105EqualEqualPass
I1555ImaginaryImaginaryPass
I2-155Invalid InputInvalid InputPass
I31155Invalid InputInvalid InputPass
I4555ImaginaryImaginaryPass
I55-15Invalid InputInvalid InputPass
I65115Invalid InputInvalid InputPass
I7555ImaginaryImaginaryPass
I855-1Invalid InputInvalid InputPass
I95511Invalid InputInvalid InputPass
I10055Not QuadraticNot QuadraticPass

In given table, first four are from output domain and other are from inputs.

Leave a Reply