CS FundamentalsHardInfosys · Product placement
A method has cyclomatic complexity 25. Which conclusion is most reasonable?
- A. It is ideal because it handles many cases
- B. Cyclomatic complexity above 20 is impossible
- 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
- 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.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- A team writes acceptance criteria as 'Given a cart worth ₹900, When the user applies coupon SAVE10, Then the total is ₹810', and automates…
- A codebase reports 100% line coverage, but the mutation score is only 20%. What is the most likely explanation?
- In TDD, a developer has one failing test, assertEqual(add(2, 3), 5), and makes it pass with return 5. What is the next step according to…
- A legacy COBOL system with no documentation is analysed to recover its design (step 1), restructured and migrated to Java with the same…
- In software configuration management, the approved requirements specification is frozen and further changes need formal approval by a…
- A team records, in short version-controlled documents, why it chose PostgreSQL over MongoDB, the context, the options considered and the…