Cyclomatic complexity

From Wiki @ Karl Jones dot com
Revision as of 05:58, 18 August 2015 by Karl Jones (Talk | contribs) (First)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Cyclomatic complexity is a software metric (measurement), used to indicate the complexity of a program.

It is a quantitative measure of the number of linearly independent paths through a program's source code. It was developed by Thomas J. McCabe, Sr. in 1976.

Cyclomatic complexity is computed using the control flow graph of the program: the nodes of the graph correspond to indivisible groups of commands of a program, and a directed edge connects two nodes if the second command might be executed immediately after the first command.

Cyclomatic complexity may also be applied to individual functions, modules, methods or classes within a program.

One testing strategy, called basis path testing by McCabe who first proposed it, is to test each linearly independent path through the program; in this case, the number of test cases will equal the cyclomatic complexity of the program.

See also

External links

  • [ Cyclomatic complexity] @ Wikipedia