Professional Documents
Culture Documents
Lecture 10a
Lecture 10a
Lecture 10
• Example:
– Nodes with condition: 1, 2, 3.
– Cyclomatic Complexity: 4.
Cyclomatic complexity and testing
• 1 - 4: low complexity – easy to test
• 5 - 7: moderate complexity – tolerable
• 8 - 10: high complexity – refactoring should be
considered to ease testing
• 11+: very high complexity – very difficult to
test
Example: calculate the Cyclomatic Complexity of the following Flow Graph
State 0 1
a a b
b c a
c b c