CTAL-TTA practice question 4 of 25

Consider the simplified logic below for crediting money to a bank account. Receive money and account number to be credited IF account number is valid…

Full set: 174 questions
Consider the simplified logic below for crediting money to a bank account. Receive money and account number to be credited IF account number is valid IF customer account is active Store current account balance as oldBalance Credit money to account IF oldBalance = zero Set message "Overdraft cleared" ELSE Set message "A/c overdrawn" ENDIF ELSE Set message = "You have more money" ENDIF IF account holder is VIP customer Send message by email to customer ENDIF ELSE Set message "A/c inactive" Send message by email to supervisor ENDIF ELSE Add 1 to count of invalid inputs ENDIF What is the minimum quantity of test cases that will give 100% statement coverage?
Answer options
A: 6
B: 5 Correct answer
C: 4
D: 3
Correct Answer:
B. 5
Explanation

To achieve 100% statement coverage, all executable statements must be executed at least once. This requires a combination of test cases to cover variations in active accounts, balance states, and valid/invalid inputs.

Why Incorrect

A. Six cases are unnecessary as some cases can overlap in coverage.
C. Four cases do not provide enough coverage for the various conditions identified.
D. Three cases are not sufficient to cover all distinct paths and statements.

References

1. "Practical Software Testing," by Ilan Goldstein, Chapter 5.

2. "Software Testing and Continuous Quality Improvement," ISBN 9781439859616, Section 4.2.

3. ISTQB Foundation Level Syllabus, Section 2.5.1.

Scroll to Top