Skip to content

Beta · Data may be lost.Your data may be reset or lost.

GateBrew
← GATE CSE 2011
Questions

Q47

MCQ2 marks, −0.67Medium

The following is the comment written for a C function.

/* This function computes the roots of a quadratic equation
   a.x^2 + 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.
   (i) When coefficient a is zero irrespective of discriminant
   (ii) When discriminant is positive
   (iii) When discriminant is zero
   (iv) When discriminant is negative
   Only in case (ii) and (iii), the stored 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 root1 >= root2.
int get_QuadRoots (float a, float b, float c,
                   float *root1, float *root2);
*/

A software engineer is assigned the job of doing black box testing. He comes up with the following test cases, many of which are redundant. Test CaseInput SetExpected Output Set abcroot1root2Return Value T10.00.07.00.00.0-1 T20.01.03.00.00.0-1 T31.02.01.0-1.0-1.00 T44.0-12.09.01.51.50 T51.0-2.0-3.03.0-1.00 T61.01.04.00.00.0-1 Which one of the following options provide the set of non-redundant tests using equivalence class partitioning approach from input perspective for black box testing?

Sign in to save attempts.

Solutions and discussion are hidden while you attempt this question. They open once you check or show the answer.