Equivalence Class testing – Programmerbay https://programmerbay.com A Tech Bay for Tech Savvy Sat, 16 Mar 2024 10:00:33 +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 Equivalence Class testing – Programmerbay https://programmerbay.com 32 32 Design the test cases and test the program of Triangle problem by using Equivalence Class testing https://programmerbay.com/design-the-test-cases-and-test-the-program-of-triangle-problem-by-using-equivalence-class-testing/ https://programmerbay.com/design-the-test-cases-and-test-the-program-of-triangle-problem-by-using-equivalence-class-testing/#respond Sat, 21 Sep 2019 16:55:39 +0000 https://programmerbay.com/?p=5283 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

]]>
https://programmerbay.com/design-the-test-cases-and-test-the-program-of-triangle-problem-by-using-equivalence-class-testing/feed/ 0
Design the test cases and test the program of previous date problem by using Equivalence Class testing https://programmerbay.com/design-the-test-cases-and-test-the-program-of-previous-date-problem-by-using-equivalence-class-testing/ https://programmerbay.com/design-the-test-cases-and-test-the-program-of-previous-date-problem-by-using-equivalence-class-testing/#respond Sat, 21 Sep 2019 16:52:47 +0000 https://programmerbay.com/?p=5284 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

]]>
https://programmerbay.com/design-the-test-cases-and-test-the-program-of-previous-date-problem-by-using-equivalence-class-testing/feed/ 0
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