what is cyclomatic complexity? plz explain with example

Answer Posted / amit

Cyclomatic Complaxity comes under white box testing.
It means best path searching. To measure logical Complaxity
of a prog.
for ex.

1-main()
2-if(a>1)
3{
------
------
}
4-else
5-{
-------
-------
}
}

Now a diagram would drawn from top as it would start from 1.
underneath it would be 2. and 2 would have two edges i.e. 3
and 4. they would futher combine to form 5.

2,3,4 & 5 would make close regeoin while outside would
become open region..

the arrows joining would be edges 2 would become predicate
node. while others are simple nodes.

it has got a formula:

v(g)=Node-edges+2
v(g)= 5-5+2
v(g)=2
v(g)= predicate node+1
v(g)=1+1
v(g)=2

So its logical correct.

Please correct me if i'm wrong.

Is This Answer Correct ?    74 Yes 29 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Need to know about Quality Center in brief

1564


What do you do (with the project staff) when the schedule fails?

1692


Hi Dear this urgent for me i have need of ROLTA India Ltd Mumbai Paper pattern for Testing Person , PLease Help me , if any body have any idea about it

3611


Explain thread testing.

727


On what basis you are fixing up the time for project completion?

857






What is a defect?

720


Have you ever completely tested any part of a product? How?

2094


Should testing be done only after the build and execution phases are complete?

1174


can any one post the format of tracebility martrix Plz...... Maid Id: sandhya.shyamala@yahoo.com

1854


how to write defects in excel sheets when defects occured

1589


What ishigh severity, low priority bug?

770


How quickly we need to fix the bug?

763


What’s the difference between a bug and a defect?

740


Explain crud testing.

710


Negatives test cases of gmail login page With its severity , priority and expected results columns Through test case template-oodles technologies gurgoan

2264