nerdexam
iSQI

CTAL-TTA_001 · Question #22

Part 1 "Test Techniques various" If you are flying with an economy ticket, there is a possibility that you may get upgraded to business class, especially if you hold a gold card in the airline's…

The correct answer is C. 80%. Statement coverage measures the percentage of numbered boxes (statements) in the diagram that are executed by the test cases combined. With 10 total numbered statements in the flowchart and the three tests collectively executing 8 of them, coverage is 8/10 = 80%, making C…

Structure-Based Testing

Question

Part 1 "Test Techniques various" If you are flying with an economy ticket, there is a possibility that you may get upgraded to business class, especially if you hold a gold card in the airline’s frequent flier program. If you don’t hold a gold card, there is a possibility that you will get ‘bumped’ off the flight if it is full and you check in late. This is shown in the figure hereafter. Note that each box (i.e. statement) has been numbered. Three tests have been run:

Test 1: Gold card holder who gets upgraded to business class Test 2: Non-gold card holder who stays in economy Test 3: A person who is bumped from the flight What is the statement coverage of these three tests? 2 credits [K4]

Options

  • A60%
  • B70%
  • C80%
  • D90%

How the community answered

(35 responses)
  • A
    6% (2)
  • B
    3% (1)
  • C
    83% (29)
  • D
    9% (3)

Explanation

Statement coverage measures the percentage of numbered boxes (statements) in the diagram that are executed by the test cases combined. With 10 total numbered statements in the flowchart and the three tests collectively executing 8 of them, coverage is 8/10 = 80%, making C correct. The two unexecuted statements are typically those representing paths not taken by any test - for example, a gold card holder who is not upgraded (stays in economy) or an intermediate node not reached by any of the three scenarios.

Why the distractors are wrong:

  • A (60%) and B (70%) undercount - they would imply 6 or 7 statements covered respectively, but the three distinct test paths together reach more statements than those figures suggest.
  • D (90%) overcounts - it assumes 9 of 10 statements are hit, but there is at least one reachable statement (e.g., the "no upgrade" outcome for a gold card holder) that none of the three tests exercises.

Memory tip: For statement coverage questions, always list every numbered box in the diagram, then trace each test path and tick off which boxes it passes through - union all three sets and divide by the total. Don't count shared boxes more than once; coverage is about unique statements reached, not total steps taken across all tests.

Topics

#statement coverage#coverage percentage#control flow graph#test execution

Community Discussion

No community discussion yet for this question.

Full CTAL-TTA_001 Practice