-
The following is comment written for a C function /* This function computes the roots of a quadratic equation. a.x2 + b.x + c = 0. The function stores two real roots. in *root1 and *root2 and returns the status of validity of roots. It handles four different kinds of cases.
1. When coefficient a is zero irrespective of discriminant
2. When discriminant is positive
3. When discriminant is zero
4. When discriminant is negative Only in cases 2 and 3, the stores roots are valid.
Otherwise 0 is stored in the roots. the function returns 0
when the roots are valid and – 1 otherwise.
The function also ensures root 1 > = root 2.
int get_QuadRoots float a, (float b, float c, float * root1, float * root2);
*/
A software test engineer is assigned the job of doing Block Box testing. He comes up with the following test cases, many of which are redundant.
Which one of the following options provides the set of nonredundant tests using equivalence class partitioning approach from input perspective for Black Box testing?
-
- T1, T2, T3, T6
- T1, T3, T4, T5
- T2, T4, T5, T6
- T2, T3, T4, T5
- T1, T2, T3, T6
Correct Option: C
Test cases T1 and T2 both are examples of a = 0. Thus, T1 and T2 are redundant.
For T3 discriminant b2 – 4ac = 4 – 4 = 0
For T4 discriminant b2 – 4ac = (– 12)2 – 4 × 9 × 4 = 144 – 144 = 0
For T5 discriminant b2 – 4ac = (– 2)2 – (– 3) × 4 × 1 = 4 + 12 = 16 > 0
Thus T5 is example of discriminant > 0
For T6 discriminant b2 – 4ac = (1)2 – 4 × 1 × 4 = 1 – 16 = – 13
Thus T6 is example of discriminant < 0. means T3 and T4 are also redundant.