Software Testing | Week 2

Session Jan-Apr 2023

Course Name: Soft Skills Development

Course Link: Click Here

These are NPTEL Software Testing Week 2 Assignment 2 Answers


Q1. 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

Answer: a. Decision-table based testing


Q2. 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

Answer: c. 3


These are NPTEL Software Testing Week 2 Assignment 2 Answers


Q3. 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.

image 70

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

Answer: d. 9


Q4. 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

Answer: c) Trojans


These are NPTEL Software Testing Week 2 Assignment 2 Answers


Q5. Consider the following program code. At least how many test cases are needed for basic condition coverage?
a. 2
b. 3
c. 4
d. 5
e. 6

Answer: a. 2


Q6. 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

Answer: a. A set of input values constitute an equivalence class if the tester believes these are processed identically.


These are NPTEL Software Testing Week 2 Assignment 2 Answers


Q7. 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.

Answer: c, d, e


Q8. 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

Answer: d. 25


These are NPTEL Software Testing Week 2 Assignment 2 Answers


Q9. 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

Answer: d. 8


Q10. Code coverage analysis is used to measure which one of the following?a
a. Extent of unreachable code
b. Sufficiency of test cases
c. Quality of code
d. Distribution of bugs
e. Percentage of bugs exposed

Answer: b. Sufficiency of test cases


These are NPTEL Software Testing Week 2 Assignment 2 Answers

More Weeks of Software Testing: Click Here

More Nptel course: https://progiez.com/nptel


Session Jul-Dec 2022

Q1. Which of the following best defines an infeasible test path?

a)An infeasible test path is one that does not exist in the graph.

b)An infeasible test path is one that can be executed by a failed test case.

c)An infeasible test path is one that cannot be executed by any test case.

d)An infeasible test path is one that does not start at an initial vertex or end at a final vertex.

Answer: b)An infeasible test path is one that can be executed by a failed test case.


Q2.How are test requirements defined and met in graphs-based structural coverage criteria?

a)Test requirements are basically the same as test paths, they are given as test paths.

b)Test requirements are defined as properties of test paths and they are met by using test paths that satisfy each test requirement.

Answer: a)Test requirements are basically the same as test paths, they are given as test paths.


These are NPTEL Software Testing Week 2 Assignment 2 Answers


Q3.In control flow graphs, which of the terms below represents a basic block?

a)A basic block is a sequence of statements such that there is no branching in the sequence.

b)A basic block is any sequence of statements that occurs as a path in the control flow graph.

Answer: b)A basic block is any sequence of statements that occurs as a path in the control flow graph.


These are NPTEL Software Testing Week 2 Assignment 2 Answers


Q4.Consider a control flow graph GG corresponding to a method and a strongly connected component SS in CC. Which of the following does SS represent in the code that GG corresponds to?

a)SS represents the entire method in case the method does not have loops.

b)SS represents a loop in the method.

Answer: b)SS represents a loop in the method.


These are NPTEL Software Testing Week 2 Assignment 2 Answers


Q5.Which of the algorithms will return the shortest paths between two nodes in a control flow graph?

w2q5
These are NPTEL Software Testing Week 2 Assignment 2 Answers

a)Breadth first search.

b)Depth first search.

Answer: a)Breadth first search.


Q6.State true or false: There are test paths that achieve node coverage but not edge coverage.

a)True.

b)False.

Answer: b)False.


These are NPTEL Software Testing Week 2 Assignment 2 Answers


Q7.Which of the following test paths achieve edge coverage?

a)Test path [1, 2, 3, 2, 4].

b)Test paths [1, 2, 4] and [1, 2, 3, 2].

c)Both the paths above achieve edge coverage.

d)None of the above two paths achieve edge coverage.

Answer: c)Both the paths above achieve edge coverage.


Q8.State yes or no: In the graph above, the test path [1, 2, 3, 2, 4] tours the pair of edges [3, 2, 3].

a)Yes.

b)No.

Answer: a)Yes.


These are NPTEL Software Testing Week 2 Assignment 2 Answers


Q9.The test paths {[1, 2, 4], [1, 2, 3, 2, 3, 2, 4]} achieve which of the following coverage criteria?

a)Node coverage only.

b)Edge coverage only.

c)Node and edge coverage only.

d)Edge pair coverage.

Answer: d)Edge pair coverage.


Q10.State true or false: The test path [1, 2, 3, 2, 4] achieves edge coverage.

a)True.

b)False.

Answer: a)True.


These are NPTEL Software Testing Week 2 Assignment 2 Answers

All weeks Software Testing: Click Here

More Solution of NPTEL: Click me



These are NPTEL Software Testing Week 2 Assignment 2 Answers

This content is uploaded for study, general information, and reference purpose only.