The GATE Grind

GATE 2011 CS (CS1) – Question 57

Software Engineering · Requirements Engineering · 2 marks · Multiple choice

A quadratic-root routine handles four input classes: a=0, positive discriminant, zero discriminant, negative discriminant. It stores ordered real roots for the middle two classes and zeros otherwise, returning zero for valid roots and −1 otherwise. Tests (a,b,c;root1,root2,return): T1=(0,0,0;0,0,−1), T2=(0,1,3;0,0,−1), T3=(1,2,1;−1,−1,0), T4=(4,−12,9;1.5,1.5,0), T5=(1,−2,−3;3,−1,0), T6=(1,1,4;0,0,−1). Which nonredundant set covers equivalence classes from input perspective?

  1. T1,T2,T3,T6
  2. T1,T3,T4,T5
  3. T2,T4,T5,T6
  4. T2,T3,T4,T5

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (C) T2,T4,T5,T6

Explanation

T1 and T2 both test a=0; T3 and T4 both test zero discriminant. T5 tests positive discriminant and T6 negative discriminant. Choose one from each of the four classes: only T2,T4,T5,T6 does so without redundancy. Thus C; root magnitudes alone do not create a new input class.

More Requirements Engineering questions

All Requirements Engineering questions →