# Software Testing NPTEL Week 2 Assignment Answers

Are you looking for Software Testing NPTEL Assignment 2 Week 2 Answers? You’ve come to the right place! Access the latest and most accurate solutions for your Week 2 assignment in the Software Testing course. Our detailed answers are designed to help you understand key concepts and excel in your studies. Stay updated with the most recent information and answers by joining our Telegram channel.

## Software Testing NPTEL Week 2 Assignment Answers ( JULY-DEC 2024 )

Q1.When do we say that a test path p tours a sub-path q with a side-trip?

A test path p tours a sub-path q with a side-trip when p is an infeasible test path on its own.

A test path p tours a sub-path q with a side-trip when every vertex and every edge in q also occurs in p
in the same order.

A test path p tours a sub-path q with a side-trip when every vertex in q also occurs in p in the same order.

A test path p tours a sub-path q with a side-trip when every edge in qalso occurs in p in the same order.

Answer: A test path p tours a sub-path q with a side-trip when every vertex and every edge in q also occurs in pin the same order.

Q2.Which of the graph traversal algorithms given below, when run on a graph that does not have edge weights, will return the shortest path between a pair of vertices?
Depth first search (DFS)
Both DFS and BFS
Neither BFS nor DFS

These are Software Testing NPTEL Week 2 Assignment Answers

Q3.Why is complete path coverage considered to be an infeasible structural graph coverage criterion?
Complete path coverage could be infeasible if the graph has several disconnected components.
Complete path coverage could be infeasible if the graph has strongly connected components or loops.
Complete path coverage could be infeasible if the graph has isolated vertices or edges.
Complete path coverage could be infeasible as covering all paths in a graph through test cases is not needed.

Answer: Complete path coverage could be infeasible if the graph has strongly connected components or loops.

Q4.Which graph coverage criterion considers writing test cases where all the simple paths of maximal length are visited?
Complete path coverage.
Simple path coverage.
Specified path coverage.
Prime path coverage.

These are Software Testing NPTEL Week 2 Assignment Answers

Q5.Which are the three vertices that will be added to the BFS queue in the first step of the BFS algorithm? Does the order in which they are added matter?
The three vertices will be 2, 3 and 4, their order will be exactly the same as the one given in this answer option.
The three vertices will be 2, 3 and 4, their order does not matter.
The three vertices will be 2, 3 and 5, their order will be exactly the same as the one given in this answer option.
The three vertices will be 2, 3 and 5, their order does not matter.

Answer: The three vertices will be 2, 3 and 4, their order does not matter.

Q6.If vertices 2, 3 and 4 are added in the queue in the given order during the BFS visit, which vertex will be marked as visited first?
Vertex 2 will be marked as visited first.
Vertex 3 will be marked as visited first.
Vertex 4 will be marked as visited first.
None of the three given vertices will be marked as visited first.

Answer: Vertex 2 will be marked as visited first.

These are Software Testing NPTEL Week 2 Assignment Answers

Q7.When will BFS traversal be complete for the given graph?
BFS traversal will be complete when all the vertices are marked as visited and the queue is empty.
BFS traversal will be complete when all the vertices are added to the queue.

Answer: BFS traversal will be complete when all the vertices are marked as visited and the queue is empty.

Q8.Which of the following represents a correct order of visit during a breadth first search traversal of the given graph starting from vertex 1?
1, 2, 3, 4, 5.
1, 4, 5, 2, 3.
1, 5, 4, 3, 5.
1, 4, 5, 2, 3.

These are Software Testing NPTEL Week 2 Assignment Answers

Q9.Which of the following represents a correct order of visit during a depth first search traversal of the given graph starting from vertex 1?
1, 4, 5, 2, 3.
1, 2, 3, 4, 5.
1, 2, 3, 5, 4.
1, 5, 4, 3, 2.

Answer: 1, 4, 5, 2, 3.

Q10.Which of the following options are true regarding DFS and BFS traversals in the given graph starting with vertex 1?
Both DFS and BFS will always visit the vertices in the same order.
DFS order of traversal need not be the same as the BFS order of traversal for the give graph.

Answer: DFS order of traversal need not be the same as the BFS order of traversal for the give graph.

These are Software Testing NPTEL Week 2 Assignment Answers

## Software Testing NPTEL Week 2 Assignment Answers ( JAN-APR 2024 )

Course name: Software Testing

These are Software Testing NPTEL Week 2 Assignment Answers

Q1. Which of the following are not black box testing techniques?
a. Boundary value testing
b. Cause-effect graph testing
c. Path testing
d. Combinatorial testing
e. Basic Condition testing

Q2. Assume you have developed a simple web-based calculator. The user interface has 3 input fields: Operand1, Operator, and Operand2. The user can give 9 valid inputs: {1, 2, .., 9} for Operand1 and also for Operand2. The user can enter four valid inputs for Operator: (+, -, *, /3. How many test cases would exhaustive functional testing require?
a. 3
b. 12
c. 22
d. 256
e. 324

Q3. Which of the following are false about white-box testing?
a. Test cases are designed using only functional specification of the software:
b. Test cases are designed without any knowledge of the internal structure of the software.
c. White-box testing is also known as structural testing.
d. Test case design requires a knowledge of the internal structure of the unit under test
e. White-box tests can detect trojans in the code
f. White-box testing can be used to detect if a software meets all its functional requirements

These are Software Testing NPTEL Week 2 Assignment Answers

Q4. Assume that a function test takes three parameters x, y, and z as arguments. Each of these three parameters can assume values in the range -100 to +100. How many boundary value test cases with valid values should be designed?
a. 7
b. 9
c. 11
d. 13
e. 17

Q5. Consider the function find-intersection(float mi, float c1, float m2, float c2) that computes the point of intersection of two straight lines of the form y=mx+c. For equivalence class testing, at the first level of the equivalent 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?
а. 1
b. 2
c. 3
d. 4
e. 6

Q6. Which of the following are not combinatorial testing techniques?
a. Decision table-based testing
b. Condition-coverage testing
c. Cause-effect graphing
d. Pair-wise testing
e. Path testing

These are Software Testing NPTEL Week 2 Assignment Answers

Q7. Which one of the following is an implicit assumption made in equivalence class testing?
a. A program behaves in similar ways to every input value belonging to an equivalence class.
b. Different equivalence classes of a program contain similar bugs
c. Different equivalence classes of a program behave similarly to an input
d. Equivalence classes define the behaviorally similar components of a program
e. Equivalence classes help identify program functions that can be considered to be behaviorally similar

Answer: a. A program behaves in similar ways to every input value belonging to an equivalence class.

Q8. Consider a function that takes an integer a (which can assume integral values between 0 to 100) as argument and carries out actions involving setting the value of a variable b as specified in the following table.
During black box testing of the function, how many valid equivalence class test cases with valid input values are required?
a. 4
b. 5
c. 8
d. 9
e. 10

Q9. Which one of the following techniques is not used to identify the equivalence classes of a unit?
a. Identity scenarios
b. Examine the input data.
c. Analyze program structure
d. Examine output
e. Develop cause-effect model of the program

These are Software Testing NPTEL Week 2 Assignment Answers

Q10. Suppose a function named try takes two Boolean variables as input. At least how many valid equivalence classes needs to be designed for the black-box testing of the function try?
a. 2
b. 4
c. 6
d. 8
e. 10

These are Software Testing NPTEL Week 2 Assignment Answers

## Software Testing NPTEL Week 2 Assignment Answers ( Jan-Apr 2023 )

These are Software Testing NPTEL Week 2 Assignment 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

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

These are Software Testing NPTEL Week 2 Assignment 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.

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

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

These are Software Testing NPTEL Week 2 Assignment 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

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 Software Testing NPTEL Week 2 Assignment 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.

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

These are Software Testing NPTEL Week 2 Assignment 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

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 Software Testing NPTEL Week 2 Assignment Answers

## Software Testing NPTEL Week 2 Assignment Answers ( 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 Software Testing NPTEL Week 2 Assignment 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 Software Testing NPTEL Week 2 Assignment 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 Software Testing NPTEL Week 2 Assignment Answers

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

b)Depth first search.

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

a)True.

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.

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.

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

a)True.

b)False.