what is cyclomatic complexity? plz explain with example

Answer Posted / devyani

Below is a simple program as an example:
IF A = 354
THEN IF B > C
THEN A = B
ELSEA= C
ENDIF
ENDIF
Print A
The control flow generated from the program would look like Figure 3.2.
The control flow shows seven nodes (shapes) and eight edges (lines), thus using the formal formula the cyclomatic complexity is 8-7 + 2 = 3. In this case there is no graph called or subroutine. Alternatively one may calculate the cyclomatic complexity using the decision points rule. Since there are two decision points, the cyclomatic complexity is 2 + 1 = 3.

Is This Answer Correct ?    6 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

why testcases are written and what is the importance?

1107


How does a coverage tool work?

693


What are the review documents used for testing?

1569


Beyond the customary advantages of having a testing group, what are the benefits does a company receive from a well run, automated testing group?

3000


if yahoo ceo asks you to do performance testing for yahoo site, what are the inputs you ask from them?

1627






Hi , Please send me the interview questions which were asked in manual testing mainly the test cases asked to write in interview.

1502


What are the different ways to check a date field in a website?

674


What is defect removable efficiency?

696


How did you do unit testing in your project?

702


What is showstopper defect?

675


Where we have to use perl scripting in Testing approach and its importance

1662


In Manual testing how to test proxy servers? can u please explain with example?

1576


Tell me example for Risk,Mitigation,Assumption?

1855


Can you explain equivalence partitioning?

593


When did u complete testing ? Which scenrio should not be in automation testing ? why ?

2392