0
23kviews
A program reads three numbers A,B,C with range[1,50] and print the largest number.Design test cases for this program using equivalence class testing techniques.
1 Answer
2
2.6kviews

First we partition the domain of input as valid input values and invalid values. so we get following classes -

$I_1$ = { <A,B,C> : 1 ≤ A ≤ 50 }

$I_2$ = { <A,B,C> : 1 ≤ B ≤ 50}

$I_3$ = { <A,B,C> : 1 ≤ C ≤ 50}

$I_4$ = { <A,B,C> : A < 1}

$I_5$ = { <A,B,C> : A > 50}

$I_6$ = { <A,B,C> : B < 1}

$I_7$ = { <A,B,C> : B > 50}

$I_8$ = { <A,B,C> : C < 1 }

$I_9$ = { <A,B,C> : C > 50}

Now test cases can be designed from the above derived classes taking one case from each class such that the test case covers maximum valid input classes and seperate test cases for each invalid class.

Test case id A B C Expected Result Classes covered test cases
1 13 25 36 C is greater $I_1, I_2, I_3$
2 0 13 45 invalid input $I_4$
3 51 34 17 invalid input $I_5$
4 29 0 18 invalid input $I_6$
5 36 53 32 invalid input $I_7$
6 27 42 0 invalid input $I_8$
7 33 21 51 invalid input $I_9$

Another set of equivalence classes based on some possibilities of 3 integers A, B, C.

$I_1$ = { < A,B,C > : A>B, A>C }

$I_2$ = { < A,B,C > : B>A , B>C }

$I_3$ = { < A,B,C > : C>A , C>B }

$I_4$ = { < A,B,C > : A = B, A + C}

$I_5$ = { < A,B,C > : B = C, A + B }

$I_6$ = { < A,B,C > : A = C, C = B}

$I_7$ = { < A,B,C > : A = B = C }

Test case ID A B C Expected Result Classes covered test cases
1 25 13 13 A is greater $I_1, I_5$
2 25 40 25 B is greater $I_2, I_6$
3 24 24 37 C is greater $I_3, I_4$
4 25 25 25 All are equal $I_7$
Please log in to add an answer.