written 5.3 years ago by | • modified 5.3 years ago |

Mumbai University > Information Technology > Sem 8 > Software Testing and Quality Assurance

Marks: 10 Marks

Difficulty : Medium

**2 Answers**

0

40kviews

Draw the control flow graph and find the cyclomatic complexity for a program largest of three numbers.

written 5.3 years ago by | • modified 5.3 years ago |

Mumbai University > Information Technology > Sem 8 > Software Testing and Quality Assurance

Marks: 10 Marks

Difficulty : Medium

ADD COMMENT
EDIT

2

4.5kviews

written 5.3 years ago by | • modified 5.3 years ago |

**Independent paths:**

An independent path is any path through the graph that introduces at least one new set of processing statement or new condition. An independent path must move along at least one edge that has not been traversed before the path is defined.

**cyclomatic complexity:**

cyclomatic complexity can be designed through the given formula

v(6) = e - n + 2p

where

**e** is the no. of edges

**n** is the no. of nodes in the graph

**p** is the no. of components in the whole graph.

void main c { int a, b, c, max,

print f ('enter 3 integers"),

scan f (" %d %d %d", & a, & , & c),b

if (a >) b

if ( a > c)

Max = a

else max = c,

else if (b > c)

Max = b

else max = c

print and ( "a max = % d", max), 3

No. of independent paths

v (a) = e - n + 2

= 11 - 9 + 2

= 4

No. of procedures = 1

$\therefore$ cyclomatic complexity

= e - n + 2 P

= 11 - 9 + 2

= 4

ADD COMMENT
EDIT

Please log in to add an answer.