nerdexam
iSQI

CTAL-TTA_001 · Question #1

What is the value of statement coverage achieved by test case 1 from test set A? 2 credits [K3]

The correct answer is A. ? 75% (21/28). Option A (75%, 21/28) is correct because test case 1 from test set A executes exactly 21 out of the 28 total executable statements in the code under test, leaving 7 statements unexercised - typically those in branches not triggered by that single test input. Options B (22/28)…

Structure-Based Testing

Question

What is the value of statement coverage achieved by test case 1 from test set A? 2 credits [K3]

Options

  • A? 75% (21/28)
  • B? 78% (22/28)
  • C? 85% (24/28)
  • D? 90% (25/28)

How the community answered

(39 responses)
  • A
    82% (32)
  • B
    10% (4)
  • C
    3% (1)
  • D
    5% (2)

Explanation

Option A (75%, 21/28) is correct because test case 1 from test set A executes exactly 21 out of the 28 total executable statements in the code under test, leaving 7 statements unexercised - typically those in branches not triggered by that single test input.

Options B (22/28), C (24/28), and D (25/28) are wrong because they each overcount the statements reached; common mistakes include counting condition expressions, comments, or declaration lines as executable statements, or mistakenly assuming certain unreachable branches get hit.

Memory tip: Statement coverage = executed statements / total statements - count only executable lines (assignments, calls, returns), never blank lines, comments, or { } delimiters. When a single test case is used, ask yourself: "which branches does this one input not reach?" - those unexecuted branches hold the gap between 75% and 100%.

Topics

#statement coverage#coverage calculation#white-box testing#code analysis

Community Discussion

No community discussion yet for this question.

Full CTAL-TTA_001 Practice