retagged by
2,855 views
4 votes
4 votes

The cyclomatic complexity of the flow graph of a program provides

  1. an upper bound for the number of tests that must be conducted to ensure that all statements have been executed at most once
  2. a lower bound for the number of tests that must be conducted to ensure that all statements have been executed at most once
  3. an upper bound for the number of tests that must be conducted to ensure that all statements have been executed at least once

  4. a lower bound for the number of tests that must be conducted to ensure that all statements have been executed at least once

retagged by

2 Answers

Best answer
8 votes
8 votes
its C as each edge must be visited at least once that's why we use cyclomatic complexity to determine the number of independent paths.
selected by
1 votes
1 votes

Ans C)


The value for V(G) provides us with an upper bound for the number of independent paths that form the basis set ( a set of independent paths for the flow graph such that if tests can be designed to force execution of these paths then every statement in the program will have been guaranteed to be executed at least one time and
every condition will have been executed on its true and false sides)
and, by implication, an upper bound on the number of tests that must be designed and executed to guarantee coverage of all program statements.

Thus, Cyclomatic complexity, V(G), for a flow graph, G, is defined as
V(G) = E - N + 2
Also, it can be defined as
V(G) = P + 1,

where P is the number of predicate nodes contained in the flow graph G. ( A predicate node is a node containing a condition.)

Answer:

Related questions

14 votes
14 votes
4 answers
2
go_editor asked Sep 29, 2014
12,581 views
The cyclomatic complexity of each of the modules $\text{A}$ and $\text{B}$ shown below is $10.$ What is the cyclomatic complexity of the sequential integration shown on t...