Software Testing - Cyclomatic Complexity
Software Testing - Cyclomatic Complexity
COMPLEXITY
http://www.tuto rialspo int.co m/so ftware _te sting _dictio nary/cyclo matic_co mple xity.htm
Co pyrig ht tuto rials po int.co m
Example :
IF A = 10 THEN
IF B > C THEN
A = B
ELSE
A = C
ENDIF
ENDIF
Print A
Print B
Print C
FlowGraph:
= E - N + P
in the flow graph.
in the flow graph.
that have exit points
T he Cyclomatic complexity is calculated using the above control flow diag ram that shows
seven nodes(shapes) and eig ht edg es (lines), hence the cyclomatic complexity is 8 - 7 + 2
=3