What is cyclomatic complexity?

Answer Posted / vidya

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. It is computed using a graph that describes
the control flow of the program. The nodes of the graph
correspond to the commands of a program. A directed edge
connects two nodes if the second command might be executed
immediately after the first command.


Definition

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.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is boundary testing?

641


What are the challenges you faced related to production environment bug?

1390


What is meant by verification and validation?

619


What is the need of test plan document?

656


Can any body worked in QA in Finincail / Trading experience. i appreciate if you ans my some questions.

1574






what is difference between smoke testing and sanity testing?

598


What is a cookie testing?

555


Hi I m working as a sqa engineer and after 1 yr i want to switch to system analyst side kindly tell me how both fields relate each other and is this easy to switch job from qa to system analyst and what's the difference b/w both fields.

1573


You have 250 outstanding requests in a bug tracking application,you have no automated build environment, or representative production environment in test, nor the hardware required.You are responsible for establishing some kind of process and order to the QA department, what would you need in terms of budget and what would your processes be, as well as how would you address the environment issues mentioned above?

1813


What kind of things that forbidden to do by a SQA Tester if He/ She don’t want to get fired?

1620


What is basis set?

586


What is the testing lifecycle?

620


What are the common problems with software automation?

606


What are the advantage and disadvantages of automated testing?

714


How would you ensure that your testing is complete and has good coverage?

664