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
can you show me the test cases on registration form
how to write defects in excel sheets when defects occured
What is fuzz testing?
What is application programming interface (api)?
Can any body tell me in real time how cookies testing is done. And please tell me the steps.And for cookies testing test cases is needed.
what are your achievements in your organization ? Guyz very very urgent , help me
What are parametere require for Performance testing?
1. what exactly is heuristic checklist approach for unit testing ?
What a team leader will test first when s/he will get new module to test?
Hello all, Can someone tell me what kind of questions i can expect from hiring manager along with two team members on final face to face interview for manual testing position.. I am switching from BA to QA as its better on benefits etc.. Thanks in advance
When the GUI Testing will be held on the V model ?
What is the test case?
Diffrernce between client server testing and web server testing.
Is there any procedure of web-site development in manual testing. If yes what are factors we should test?
Please send any one latest 3+ years of experience testing tools resumes my mail id is krishnavenimodaliar26@gmail.com