what is cyclomatic complexity? plz explain with example
Answer Posted / dheemanth kumar
Cyclomatic complexity is a software metric (measurement).
It was developed by Thomas McCabe and is used to measure
the complexity of a program. It directly measures the
number of linearly independent paths through a program's
source code.
M = E − N + 2P
where
M = cyclomatic complexity
E = the number of edges of the graph
N = the number of nodes of the graph
P = the number of connected components.
"M" is alternatively defined to be one larger than the
number of decision points (if/case-statements, while-
statements, etc) in a module (function, procedure, chart
node, etc.), or more generally a system.
Separate subroutines are treated as being independent,
disconnected components of the program's control flow graph.
[edit] Alternative definition
v(G) = e − n + p
G is a program's flowgraph
e is the number of edges (arcs) in the flowgraph
n is the number of nodes in the flowgraph
p is the number of connected components
[edit] Alternative way
There is another simple way to determine the cyclomatic
number. This is done by counting the number of closed loops
in the flow graph, and incrementing the number by one.
i.e.
M = Number of closed loops + 1
where
M = Cyclomatic number.
| Is This Answer Correct ? | 19 Yes | 16 No |
Post New Answer View All Answers
What is quality center? How many built in tables does quality center have?
What are the Major Functionality for a ATM machine ??
iwant know IEEE formate ,how it is used and exactly where it is used? i have details it follows test plan, testcases...etc. i want real time explanation. pls any one give?
How do you Prepare a Defect Managemnt Policy
Can you explain exploratory testing?
What is a test severity and test priority? difference between them with suitable examples?
What is Mixed Testing
Write the test cases for yahoo home page
What is showstopper defect?
Being an Manual tester, what will be the role or activity in test plan ?
Explain the defect life cycle.
How do you test for the coockies for a web application?
Iam new to testing field and i put lot of experiences so i want to get prepared for the interview in all the ways both in manual and Automation can any one help me how to answer there questions in real time. also can anyone send the top questions and answers to me plz its urget u can mail me at vaisu72@yahoo.com
What types of software testing are available?
What icon is used in WinRunner to get an explanation of the syntax of TSL?