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

Explain Test Plan with example? Explain following in the test plan with examples What is being tested? What are pass/fail criteria? When will each test occur? What Hardware & Software environment is required? What features must be tested? What features will not be tested? What are the responsibilities of individuals & organisation in the project?

2149


What is the difference between qa, qc, and testing?

790


!what are the entry criteria for antomation testing ?

2002


Hi guys,I have 3+ years of exp in manual testing in a bangalore based MNC company.I Like to jump in chennai.So please if u know any jobs in chennai firms please let me know in my email-id. anbarasu2k@rediffmail.com. cheers, anbarasu.

1471


what are the risk factors in the project? what is the base for testplan and entry criteria ,exit criteria for test plan?

1946






what technical problem u face in your module please tell what is it mean its any bug or anything else i want ans give any example which ever modul u r working for u can give me any example

1859


What are the various techniques in black box testing?

731


Can you please provide me the standard testcase review templete and Test plan templete.In my company we are not following any Standards templete so.Please guve me some Excell attachments.

2138


Why Equivalence Partitioning is called equivalence or what is the significance of equivalence term in ECP?

1637


Do write a separate test case for regression testing? If it is yes, explain how to write the test case?

727


Functional and Integration test scenarios for actitime application

6374


How to test an application if it was already developed and it is in the state of changing the functionality according to the customer requirement How to start testing in this situation. I got an application to test.It is a desktop application.It is still developing and started 8 months back.how can i start to test this application? Is it the right way to test it in "Random testing"? or writing the testcases from page one and executing them.i have an another responsibility that is I have to automate that application. can anyone tell me what is the process to test this application.

1555


What are the modules of quality center?

657


can anyone help me regarding testing patterns?

1567


how to test the case with 5 combination and inputs

1610