NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
Software Testing
Assignment- 2
TYPE OF QUESTION: MCQ/MSQ
Number of questions: 10 Total mark: 10 X 1 = 10
For each of the following questions one or more of the given options are correct. Choose the
correct option(s).
QUESTION 1:
Cause-effect test cases are, in effect, are designed using which one of the following types of testing
techniques?
a. Decision-table based testing
b. Coverage-based testing
c. Fault-based testing
d. Path-based testing
e. Equivalence testing
Correct Answer: a. Decision-table based testing
Detailed Solution:
Cause Effect Graphing based technique is a technique in which a graph is used
to represent the situations of combinations of input conditions. The graph is
then converted to a decision table to obtain the test cases.
QUESTION 2:
Consider the function find-intersection (m1,c1,m2,c2) that computes the point of intersection of two
straight lines of the form y=mx+c. For equivalence class testing of the given function, at the first level of
the equivalence class hierarchy the valid and invalid equivalence classes can be formed. The valid set of
input values can be further divided into how many equivalence classes?
a. 1
b. 2
c. 3
d. 4
e. 5
Correct Answer: c. 3
Detailed Solution:
The valid input divided in equivalence classes are the following:
• Parallel lines (m1=m2, c1≠c2)
• Intersecting lines (m1≠m2)
• Coincident lines (m1=m2, c1=c2)
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
QUESTION 3:
Consider a function compute-grade has been written by the academic unit of an Institute to compute the
grade of a student from the marks obtained. Assume that the following grading scheme is being used by
the academic Institute.
Marks Grade
>=0 and <30 F
>= 30 and <50 P
>=50 and <60 D
>=60 and <70 C
>=70 and <80 B
>=80 and <90 A
>=90 and <=100 Ex
During black box testing of the function compute-grade, altogether at least how many equivalence
test cases are needed to be designed, assuming that robust testing is targeted?
a. 6
b. 7
c. 8
d. 9
e. 10
Correct Answer: d. 9
Detailed Solution:
For equivalence robust testing valid and invalid both classes are considered. In this question, we can
observed from the given table, 7 are valid classes and two invalid classes: Marks<0 and Marks>100. So,
total test cases = 9.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
QUESTION 4:
Which one of the following types of bugs may not get detected in black-box testing, but are very likely to
be get detected by white-box testing?
a) Incorrect functionality
b) Missing functionality
c) Trojans
d) Incorrect algorithm
e) Performance errors
Correct Answer: c. Trojans
Detailed Solution:
Incorrect or missing functionality can be detected by black-box testing. Also, incorrect algorithm,
performance issues may get detected by black-box testing. But, trojan is a programming bug
which can be detected by white-box testing.
QUESTION 5:
Consider the following program code. At least how many test cases are needed for basic condition
coverage?
int find_m(int i, int j, int k){
int m;
if(i>j) then m=j+k;
if(i>k) and (k<100) then m=i;
else m=k;
return(m);
}
a. 2
b. 3
c. 4
d. 5
e. 6
Correct Answer: a. 2
Detailed Solution:
In basic condition coverage, each atomic condition assume T and F values. So, two test cases is
enough to check that. For example, i=90, j=9, and k=50 will make all conditions true and i=4,
j=101, and k=149 will make all conditions false.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
QUESTION 6:
Which one of the following captures the basic idea based on which design of the equivalence classes of a
function based on its specification is carried out?
a. A set of input values constitute an equivalence class if the tester believes these are
processed identically.
b. A set of test cases constitute an equivalence class, if the tester believes that these are
processed differently
c. A set of input values that are partially ordered constitute an equivalence class
d. A set of dissimilar input values constitute an equivalence class
e. Equivalence classes define the behaviorally similar components of a program
Correct Answer: a. a set of input values constitute an equivalence class if the tester believes
these are processed identically.
Detailed Solution:
Program behaves in identical ways to every input value belonging to an equivalence class. So, option a. is
correct.
QUESTION 7:
Which of the following is/are false regarding white-box testing?
a. White-box test cases designed based on the code structure of a program.
b. White-box testing is also called structural testing.
c. White-box test cases designed based on the design of a program.
d. White-box test cases designed based on the requirements specification of a program.
e. White-box testing is also called behavioral testing.
Correct Answer: c. white-box test cases designed based on the design of a program
d. White-box test cases designed based on the requirements specification of a program.
e. White-box testing is also called behavioral testing.
Detailed Solution:
White-box testing is a structural testing and it is based on the code structure of a program. Black box
testing called behavioral testing.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
QUESTION 8:
Assume that a function try takes four parameters w, x, y, and z as arguments. Each of these four
parameters can assume values in the range 0 to 100. How many boundary value test cases should be
designed for robust testing of the function try?
a. 9
b. 13
c. 17
d. 25
e. 30
Correct Answer: d. 25
Detailed Solution:
In general, there will be (6n+ 1) test cases for n independent inputs. Here, number of independent
inputs = 4.
S0, Boundary value test cases for robust testing = 6*n+1=6*4+1=25.
QUESTION 9:
At least how many test cases are required to achieve multiple condition coverage of the following code
segment:
If((a>5) and (b<100) and (c>50)) x=x+1;
a. 2
b. 4
c. 6
d. 8
e. 12
Correct Answer: d. 8
Detailed Solution:
Total independent condition =3. So, test cases required for multiple condition coverage:
2^3 =8.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
QUESTION 10:
Code coverage analysis is used to measure which one of the following?
a. Extent of unreachable code
b. Sufficiency of test cases
c. Quality of code
d. Distribution of bugs
e. Percentage of bugs exposed
Correct Answer: b. Sufficiency of test cases
Detailed Solution:
Code coverage is a white box testing measure used to
describe the degree to which the source code of a program
has been tested. Coverage analysis is used to assure quality of
your set of tests, not the quality of the actual product.
************END***********