Quadratic Equation problem – Programmerbay https://programmerbay.com A Tech Bay for Tech Savvy Sat, 21 Sep 2019 17:04:16 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 https://programmerbay.com/wp-content/uploads/2019/09/cropped-without-transparent-32x32.jpg Quadratic Equation problem – Programmerbay https://programmerbay.com 32 32 Design the test cases and test the program of Quadratic Equation problem by using Equivalence Class testing https://programmerbay.com/design-the-test-cases-and-test-the-program-of-quadratic-equation-problem-by-using-equivalence-class-testing/ https://programmerbay.com/design-the-test-cases-and-test-the-program-of-quadratic-equation-problem-by-using-equivalence-class-testing/#respond Sat, 21 Sep 2019 11:46:02 +0000 https://programmerbay.com/?p=5282 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.

]]>
https://programmerbay.com/design-the-test-cases-and-test-the-program-of-quadratic-equation-problem-by-using-equivalence-class-testing/feed/ 0