OA. free
Free
Fujitsu Quantitative Aptitude Quantitative Aptitude Medium

What does the term "Cyclomatic Complexity" measure in software development?

Fujitsu aptitude question, verified with a worked answer. Free to practise - no sign-up.

What does the term "Cyclomatic Complexity" measure in software development? fg @® @ oonrosmins2sec G)+ What does the term "Cyclomatic Complexity" measure in software development? AP ontrol flow - A) The number of code lines in a program - B) The number of variables used in a function. - C) The number of linearly independent paths through a program's c - D) The number of classes in an object-oriented system

Choose one option.
Show answer & explanation
Answer: C. The number of linearly independent paths through a program's c

Cyclomatic complexity is a software metric used to indicate the complexity of a program by counting the number of linearly independent paths through its source code, which directly relates to the number of decision points (like if-statements and loops).

Step-by-step Derivation:
Step 1: Define Cyclomatic Complexity. It was developed by Thomas J. McCabe, Sr. in 1976 to measure the logical complexity of a program.
Step 2: Analyze the mathematical formula. For a control flow graph G, the complexity M is calculated as M = E - N + 2P, where E is the number of edges, N is the number of nodes, and P is the number of connected components (usually P=1 for a single function).
Step 3: Evaluate the options.

  • Option A (Lines of code) measures size, not complexity.
  • Option B (Variables) measures state space, not control flow.
  • Option C (Linearly independent paths) matches the formal definition of the metric.
  • Option D (Number of classes) measures architectural scale in OOP, not the internal logic of a function.
    Step 4: Conclusion. Option C is the technically accurate definition.