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
hi this is satish can some one help me out by sending the maxium notes on client sesrver ,web server and company architechture project hirearchy and company hirearchy i will happy to recive the answers as early as possible
What do you think the role of test-group manager should be? Relative to senior management?
How can write testcases on a code under development pls give asnwer
how to access a build & wat is its configuration
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 kind of input do we need from the end user to begin proper testing?
PLS SEND REAL TIMERS, WHAT IS SOA TESTING..IM TRYING 3+ YR.. I HAVE GOOD KNOWLEDGE ON MANUAL TESTING... NOW IM NEW TO LEARN "SOA TESTING" IS BEST OR NOT? BEFORE LEARNING SOA TESTING ANY SKILLS ARE REQUIRED..... AND NOW WHAT IS THE MARKET FOR SOA TESTING... AND IT IS BASED ON PROGRAMMING OR NOT?
Hello, I want to know how to write a regression test plan? Can someone please send me the format/template? Thanks in advance
Hi, I am planing to give ISTQB - Foundation level exam. Can anyone forward the ISTQB materials at laxmi_002@rediffmail.com mail ID.
9.Data – driver automation typically includes?
How we can test Cookies Manually?
wat is meant by frontend and backend testing
Can u give me explanation about section 508 testcase and Testcase for this section. It need a details checklist for the same Manimozhi
user id @ yahoo.com (or) yahoo.co.in (or) gmail.com.... etc
Hi , Please send me the interview questions which were asked in manual testing mainly the test cases asked to write in interview.