CS FundamentalsHardInfosys · Product placement

A method has cyclomatic complexity 25. Which conclusion is most reasonable?

  1. A. It is ideal because it handles many cases
  2. B. Cyclomatic complexity above 20 is impossible
  3. C. It is above the commonly cited threshold of 10; it needs at least 25 tests for basis-path coverage and is a strong refactoring candidate
  4. D. It can be fully branch-covered with 2 tests

Correct answer: C. It is above the commonly cited threshold of 10; it needs at least 25 tests for basis-path coverage and is a strong refactoring candidate

McCabe suggested 10 as an upper limit; 25 independent paths mean many tests and a high defect risk. Extracting methods or replacing conditionals with polymorphism lowers it.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic