0% found this document useful (0 votes)
8 views3 pages

Assignment 2

Swayam 2

Uploaded by

Himanshu Ranjan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

Assignment 2

Swayam 2

Uploaded by

Himanshu Ranjan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

NOC24-CS91: Software Testing

Week 2 Assignment
Maximum marks: 10, each question carries one mark.

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

(a) A test path p tours a sub-path q with a side-trip when p is an infea-


sible test path on its own.
(b) 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.
(c) 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.
(d) A test path p tours a sub-path q with a side-trip when every edge in
q also occurs in p in the same order.

Correct answer: Option 4.


2. 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?

(a) Depth first search (DFS)


(b) Breadth first search (BFS)
(c) Both DFS and BFS
(d) Neither BFS nor DFS

Correct answer: Option 2.


3. Why is complete path coverage considered to be an infeasible structural
graph coverage criterion?
(a) Complete path coverage could be infeasible if the graph has several
disconnected components.
(b) Complete path coverage could be infeasible if the graph has strongly
connected components or loops.
(c) Complete path coverage could be infeasible if the graph has isolated
vertices or edges.
(d) Complete path coverage could be infeasible as covering all paths in
a graph through test cases is not needed.
Correct answer: Option 2.
4. Which graph coverage criterion considers writing test cases where all the
simple paths of maximal length are visited?

(a) Complete path coverage.

1
(b) Simple path coverage.
(c) Specified path coverage.
(d) Prime path coverage.

Correct answer: Option 4.


The following six questions are about breadth first search and depth first
search algorithms on a given graph. Consider an undirected graph G =
(V, E) given below, where the set of vertices V = {1, 2, 3, 4, 5} and the
set of edges E = {(1, 2), (1, 3), (1, 4), (3, 2), (3, 5)}. We run BFS and DFS
algorithms on this graph starting from the vertex 1 which is the initial
vertex. Answer the following questions.

1 4

2 5

5. 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?

(a) The three vertices will be 2, 3 and 4, their order will be exactly the
same as the one given in this answer option.
(b) The three vertices will be 2, 3 and 4, their order does not matter.
(c) The three vertices will be 2, 3 and 5, their order will be exactly the
same as the one given in this answer option.
(d) The three vertices will be 2, 3 and 5, their order does not matter.

Correct answer: Option 2.


6. 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?

(a) Vertex 2 will be marked as visited first.


(b) Vertex 3 will be marked as visited first.
(c) Vertex 4 will be marked as visited first.
(d) None of the three given vertices will be marked as visited first.

Correct answer: Option 1.

2
7. When will BFS traversal be complete for the given graph?

(a) BFS traversal will be complete when all the vertices are marked as
visited and the queue is empty.
(b) BFS traversal will be complete when all the vertices are added to the
queue.

Correct answer: Option 1.


8. Which of the following represents a correct order of visit during a breadth
first search traversal of the given graph starting from vertex 1?

(a) 1, 2, 3, 4, 5.
(b) 1, 4, 5, 2, 3.
(c) 1, 5, 4, 3, 5.
(d) 1, 4, 5, 2, 3.

Correct answer: Option 1.


9. Which of the following represents a correct order of visit during a depth
first search traversal of the given graph starting from vertex 1?

(a) 1, 4, 5, 2, 3.
(b) 1, 2, 3, 4, 5.
(c) 1, 2, 3, 5, 4.
(d) 1, 5, 4, 3, 2.

Correct answer: Option 3.

10. Which of the following options are true regarding DFS and BFS traversals
in the given graph starting with vertex 1?

(a) Both DFS and BFS will always visit the vertices in the same order.
(b) DFS order of traversal need not be the same as the BFS order of
traversal for the give graph.

Correct answer: Option 2.

You might also like