CS FundamentalsHardProduct-company MCQ pattern
How many of the following statements about cyclomatic complexity are correct? 1. It equals the number of linearly independent paths through the control flow graph. 2. It gives an upper bound on the number of test cases needed for full branch coverage. 3. For a program with only binary decisions, it equals the number of predicate nodes plus one. 4. A function with cyclomatic complexity 1 contains no decision points.
- A. Only one
- B. Only two
- C. Only three
- D. All four
Correct answer: D. All four
All four are standard properties. Basis-path testing uses V(G) test cases, which is always enough for branch coverage (an upper bound), and V(G) = predicates + 1 for binary decisions; V(G) = 1 means straight-line code.
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 function has three integer inputs. How many test cases does worst-case boundary value analysis (every combination of min, min+, nom…
- main has commits A–B–C. Branch feature was created from B and has commits D–E. On feature you run git rebase main. How many of these…
- How many of the following statements about git reset are correct? 1. git reset --mixed HEAD~1 removes the last commit and leaves its…
- On main you run git merge --squash feature and then git commit. Afterwards you try git branch -d feature. What happens?
- You checked out an old commit by its hash, made two commits, then ran git checkout main. What happened to those two commits?
- A file secrets.env was committed last month. Today you add secrets.env to .gitignore and commit. Why does git status still show changes to…