The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+4 votes

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.

Input Set Expected Output Set
a b c root1 root2 Return Value
T1 0.0 0.0 7.0 0.0 0.0 -1
T2 0.0 1.0 3.0 0.0 0.0 -1
T3 1.0 2.0 1.0 -1.0 -1.0 0
T4 4.0 -12.0 9.0 1.5 1.5 0
T5 1.0 -2.0 -3.0 3.0 -1.0 0
T6 1.0 1.0 4.0 0.0 0.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?

(A) T1, T2, T3, T6

(B) T1, T3, T4, T5

(C) T2, T4, T5, T6

(D) T2, T3, T4, T5

asked in IS&Software Engineering by Veteran (101k points)
retagged by | 544 views

1 Answer

+5 votes
Best answer
In Black Box Testing we just focus on inputs and output of the software system without bothering about internal knowledge of the software .

Equivalence partitioning is a software testing technique that divides the input data of a software unit into partitions of equivalent data from which test cases can be derived

. As T1 and T2 checking same condition a=0

So,we can select T1 or T2.

For T3 ,T4 (b^2-4ac)=0.

so , we can select T3 or T4.

for T5 (b^2-4ac) > 0

for T6 (b^2-4ac) < 0

So, C is the answer.
answered by Junior (797 points)
selected by
What is the significance of Equivalence partitoning here? What would be the result if equivalent partitonling were not used? and What would be the answer if White Box testing were used?

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

39,751 questions
46,766 answers
58,522 users