what is cyclomatic complexity? plz explain with example
Answers were Sorted based on User's Feedback
Answer / deep singh kushwaha
Cyclomatic complexity is a software metric (measurement) 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.
One of the ways is 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.
Implications for Software Testing
M is a lower bound for the number of possible paths through the control flow graph.
M is an upper bound for the number of test cases that are necessary to achieve a complete branch coverage.
For example, consider a program that consists of two sequential if-then-else statements.
if (c1) {
f1();
} else {
f2();
}
if (c2) {
f3();
} else {
f4();
}
To achieve a complete branch coverage, two test cases are sufficient here.
For a complete path coverage, four test cases are necessary.
The cyclomatic number M is three, falling in the range between these two values, as it does for any program.
please suggest me if i m wrong..
e-mail-deepsingh.154@gmail.com
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / err. nilesh
cylomatic complexity is technique used to find out the path
coverage.Mathematically, the cyclomatic complexity of a
structured program[note 1] is defined with reference to the
control flow graph of the program, a directed graph
containing the basic blocks of the program, with an edge
between two basic blocks if control may pass from the first
to the second. The complexity M is then defined as:[2]
M = E − N + 2P
where
E = the number of edges of the graph
N = the number of nodes of the graph
P = the number of connected components
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / rahul
it is used to find out no. of independent path in graph.
v(g)=e-n+2p
v(g)=cyclomatic complexity of graph g
e=no.of edges in th graph
n=no. of node in tha graph
p=no.of connected component in the graph
Is This Answer Correct ? | 2 Yes | 3 No |
Answer / nitin verma
In the Cyclometris Complexity we find the shortest path
between the nodes.The formula is
V(G)=e-n+2p where,
G= Graph
e= no. of edges
n= nodes
p= no. of paths
plz Correct me if i m wrong....
nitin9360@yahoo.com
Is This Answer Correct ? | 27 Yes | 36 No |
Answer / karthikraj
Its a Whitebox technices
In this we findout the total number of paths......
Is This Answer Correct ? | 9 Yes | 31 No |
why feature not to be tested in test plan
what are the various techniques you will use as soon as the srs was given to you to speedup the testing?
Diff B/w Test Strategy and test plan
what is diff b/w resting & regression testing?
What is the difference between Requirement and Specification?
(urgent)hi all can any one answer to following questions.i have an interview tomorrow.it will be a great help if any one answer to this questions.thanks all. 1.when ever we get a build do we need to do smoke test is it compulsory,and how much do they spend for test. 2.generally all the testcases are stored in which place in real time.is there tool used to store that testcases and test plan,suppose we are using test director can we store all our test cases in it, and where does entire application test cases and test plan is stored assuming that company is using test director. 3.and when we file a bug,and it gets fixed after that do we need to do regressing testing only on that test case or any other test cases also.how the process will be there in real time. 4.when ever a new feature is added to the application do all the test cases to be re executed. 5. can we use toad, winaql in oracle database to access sql queries.
HOW TO CREATE SRS REVIEW REPORT TO PL?
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.
Waht is the difference between system test case and functionlity test case?.
what is the methodology you are using in ur company?
how do u perform monkey testing on website? plz dont give definitions? plz tell me some abnormal actions on website?
5 positive and 5 negative test cases for yahoo login window