Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Cyclomatic Complexity

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 256
    Comment on it

    Cyclomatic complexity metric was firstly introduced by Thomas J. McCabe in 1976,  based on control flow representation of the program.

     

    • It is used to refer the complexity of the program(source code).
    • It is a measure of  the number of independent paths in a source code of the program that is correlated to n number of coding errors.
    • The number of linearly- independent paths through a program is measured  using control flow graph to calculate the cyclomatic complexity.
    • It is calculated as reference to classes, method's, modules and function within a program.


    Cyclomatic Complexity V(G) = E- N+2

    Where E= Total no. of edge in the flow graph
    N= Number of nodes in the flow graph

     

    Properties of Cyclomatic complexity:

    • Maximum number of independent path are equal to V(G)
    • Cyclomatic complexity can be equal to 1 or more than 1.
    • If cycolmatic complexity equal to 1 then graph will have one path.
    • Complexity Number 1-10 represents that code is written in good structured way and efforts and costs are low.
    • If complexity number is 10-20  means  complex code and cost and effort is medium
    • If complexity number is 20-40 means Very complex code and cost and effort is high
    • If complexity number is >40 means cost and effort is very high

    How useful is:

    • In white box testing, basis path testing ensures to execute atleast one statement during testing
    • To determine the total number of test cases required for complete coverage of the module.

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: