Machine-translated by Google. Questions are authored in English.
Top

Discussion

What is cyclomatic complexity used to measure ?

  • A.Code size
  • B.Code complexity and number of independent paths
  • C.Execution time
  • D.Memory usage

Answer: B

Cyclomatic complexity measures code complexity and the number of independent paths.

McCabe's cyclomatic complexity is computed from the control flow graph:

\[ V(G) = E - N + 2P \]

where E is the number of edges, N the number of nodes and P the number of connected components. For one routine it equals the number of decision points plus one. It gives the number of linearly independent paths, and so the minimum number of test cases for basis path testing.

It does not measure code size (lines of code), execution time or memory usage.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.