• edited by
4,440 views
4 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.

Test
Case
Input 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?

(A) T1, T2, T3, T6

(B) T1, T3, T4, T5

(C) T2, T4, T5, T6

(D) T2, T3, T4, T5

1 Answer

Best answer
6 6 votes
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.
• selected by
Answer:
Position:
Show:

Related questions

4 4 votes
1 answers 1 answer
7.6k
7.6k views
go_editor asked Sep 29, 2014
7,609 views
A company needs to develop a digital signal processing software for one of its newest inventions. The software is expected to have 40000 lines of code. The company needs ...
9 9 votes
5 answers 5 answers
9.0k
9.0k views
go_editor asked Sep 28, 2014
8,957 views
In the context of modular software design, which one of the following combinations is desirable?High cohesion and high couplingHigh cohesion and low couplingLow cohesion ...
75 75 votes
4 answers 4 answers
24.7k
24.7k views
go_editor asked Sep 29, 2014
24,654 views
On a non-pipelined sequential processor, a program segment, which is the part of the interrupt service routine, is given to transfer $500$ bytes from an I/O device to mem...
6 6 votes
1 answers 1 answer
9.8k
9.8k views
go_editor asked Sep 29, 2014
9,837 views
A company needs to develop a strategy for software product development for which it has a choice of two programming languages L1 and L2. The number lines of code (LOC) de...