Monday, September 6, 2010

What is meant by cyclomatic complexity? Explain With Example?

It is used to measure the complexity of software process& it<br>is used to measure how many test cases are passed in the<br>application

Cyclomatic Complaxity comes under white box testing.<br>It means best path searching. To measure logical Complaxity <br>of a prog.<br>for ex.<br><br>1-main()<br>2-if(a>1)<br>3{<br>------<br>------<br>}<br>4-else<br>5-{<br>-------<br>-------<br>}<br>}<br><br>Now a diagram would drawn from top as it would start from 1.<br>underneath it would be 2. and 2 would have two edges i.e. 3 <br>and 4. they would futher combine to form 5.<br><br>2,3,4 & 5 would make close region while outside would <br>become open region..<br><br>the arrows joining would be edges 2 would become predicate <br>node. while others are simple nodes.<br><br>it has got a formula:<br><br>v(g)=Node-edges+2<br>v(g)= 5-5+2<br>v(g)=2<br>v(g)= predicate node+1<br>v(g)=1+1<br>v(g)=2

No comments:

Post a Comment