Q: 6
Given the Following program IF X = ZTHEN Statement 2;ENDMcCabe’s Cyclomatic Complexity is :
Options
Discussion
Option B is correct. There’s only a single IF decision here, so complexity is 3 (number of decision points plus 1). Option D would be if there were more branches or compound conditions, but that isn’t the case with this code. Pretty sure that’s how McCabe goes-correct me if I missed something!
B tbh, since only one independent path plus entry/exit so the tricky IF counts once.
Probably B, since there's one decision so cyclomatic complexity is 3. Seen similar in sample questions.
B , single IF means one decision so cyclomatic complexity is 2 (decisions) minus 1 (nodes) plus 2. That lands you at 3. Maybe I missed something subtle but pretty sure that's how the formula works.
It's B. Only one IF means one decision point, so you add 2 to that for the formula. D can trip people up if they think compound or multiple branches.
C or B seen on practice exams, but official ISTQB guide shows B for single IF cases.
Be respectful. No spam.