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
consider therez 1 land and it has mango trees in it, what are the tets cases or how will we count no of mangoes on all trees
1.What types of documents would you need for QA, QC, and Testing?
Hi Could someone please provide Siebel Testing Interview questions for 5 years exp.
What are quality assurance and quality control?
Please can any one tell me 1).Types of reports 2).Types of Meetings.
There is only requirements document. You have 10 days and 8 resources to release the system.At the end of the 8th day u tell ur TL that system is ready for release. How will you proceed with the testing process or in other words what all approach you will follow once you get requirements
What does entry and exit criteria mean in a project?
What are the cases when you’ll consider to choose automated testing over manual testing?
How the application is launched to the production environment?
WHAT IS PROTOCAL TESTING..EXPLAIN? L2, L3 PROTOCALS TESTING MEANS WHAT?EXPLAIN BRIEFLY
You want a automation tool to be used for your project. How will you convince the client for the same. Please give me specific answer.
What is a bug triage?
write test condition for testing SMS service of a mobile phone maximun length is 100 character while sending and 80 character for receiving write test scenarios do not write test cases
My name is Akpos from Nigeria. I have finished manual testing course. Please, can someone advise me where to go on from here?
what is JAVA TESTING? What Testers will do in JAVA Testing. Can any one Give suitable Ans Pls. it's urgent