Difference between revisions of "Cyclomatic complexity"
From Wiki @ Karl Jones dot com
Karl Jones (Talk | contribs) |
Karl Jones (Talk | contribs) (→External links) |
||
Line 28: | Line 28: | ||
* [https://en.wikipedia.org/wiki/Cyclomatic_complexity Cyclomatic complexity] @ Wikipedia | * [https://en.wikipedia.org/wiki/Cyclomatic_complexity Cyclomatic complexity] @ Wikipedia | ||
+ | |||
+ | [[Category:Complexity]] | ||
+ | [[Category:Computer science]] | ||
+ | [[Category:Computing]] | ||
+ | [[Category:Mathematics]] | ||
+ | [[Category:Software]] | ||
+ | [[Category:Software development]] |
Revision as of 14:24, 22 April 2016
Cyclomatic complexity is a software metric used to indicate the complexity of a computer program.
Description
Cyclomatic complexity is a quantitative measure of the number of linearly independent paths through a program's source code.
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
- 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.
Basis path testing
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.
History
It was developed by Thomas J. McCabe, Sr. in 1976.
See also
External links
- Cyclomatic complexity @ Wikipedia