20.5k views
5 votes
A way of measuring McCabe's cyclomatic complexity for a structured program is counting the number of decisions in the program and adding ______________

User Agustinus
by
8.0k points

1 Answer

2 votes

Final answer:

To measure McCabe's cyclomatic complexity, count the decisions in a program and add one for the starting point.

Step-by-step explanation:

McCabe's cyclomatic complexity is a software metric used to indicate the complexity of a program. It is calculated by counting the number of linearly independent paths through a program's source code. A straightforward method to measure McCabe's cyclomatic complexity is to count the number of decisions in the program and adding one for the program's starting point.

For example, if a program contains four if statements, three while loops, and one for loop, this would constitute eight decisions. Adding one for the starting point results in a cyclomatic complexity of nine.

User Titlacauan
by
7.8k points