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 smoke testing and what is sanity?
1.What types of documents would you need for QA, QC, and Testing?
Hi could some one please send me the testplan testcases(for 2Modules) and testscripts for mercry fliht aplication or gmail. please write those on templates and send me.In testplan plase write Testobjective, test scope, est approach, exlusions assumptios.
value momentum
which of the following is not a coding defect? Option 1 Test harness defect Option 2 Data flow defect Option 3 Initialisation defect Option 4 Algorithmic defect
what are the possible test cases for online jobs search portal..if its a job seeker module and any 1 if u had worked on this proj pls share the bugs with sev and priority pls frends i need replies for these queries ..thanks in advance
Hi All. How can we write negative test cases for Logout Operation ? Please place the answer with a few details and if possible add some related object properties. "A tester exposes his/her ability not only by words he/she also proof it by work"
Define Stability, Scalability and reliability with example ?
What is frame level testing and how do we test it?
Explain about PET Model?
1.what kind of testing have you done ?
Any one send me sample question for multimedia testing with microsoft access database. I am having interview next week. Please post it or send me my personal e-mail. Thank You
Anyone tell me the test cases of Shopping Favorite
what is entry and exit criteria and explain it?
What is severity and priority of bug? Give some example.