Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

ISTQB Exam CTFL-Foundation Topic 1 Question 12 Discussion

Actual exam question for ISTQB's CTFL-Foundation exam
Question #: 12
Topic #: 1
[All CTFL-Foundation Questions]

Consider the following pseudo code

1. Begin

2. Read Gender

3. __Print ''Dear''

4. If Gender = 'female'

5. Print (''Ms'')

6. Else

7. __Print ( ''Mr'')

8. Endif

9. End

How many test cases are needed to achieve 100 per cent decision coverage?

Show Suggested Answer Hide Answer
Suggested Answer: D

Contribute your Thoughts:

Corinne
17 days ago
Wait, what if the gender is 'other'? Shouldn't we test that case too? Or maybe the code should just use 'Mx' instead of 'Mr' or 'Ms'.
upvoted 0 times
...
Latia
20 days ago
Well, at least this question doesn't involve any complex algorithms or data structures. I can handle a simple if-else statement!
upvoted 0 times
Leigha
12 hours ago
True, this question is pretty straightforward. Just need to cover both branches of the if-else statement.
upvoted 0 times
...
...
Rodolfo
1 months ago
Hmm, I'm not sure. Maybe I should draw a decision tree to visualize all the possible paths. That might help me figure this out.
upvoted 0 times
...
Louis
1 months ago
I think the question is pretty straightforward. You just need to check the two possible outcomes of the gender check, right?
upvoted 0 times
...
Dominga
2 months ago
I believe the answer is C) 3, as we need to test for 'female', 'male', and the default case.
upvoted 0 times
...
Leslie
2 months ago
I agree with Dannie, because we need to test both the 'female' and 'male' branches.
upvoted 0 times
...
Valene
2 months ago
The correct answer is B) 2 test cases. One for 'female' and one for 'male' to achieve 100% decision coverage.
upvoted 0 times
Elouise
1 days ago
Thanks for the clarification!
upvoted 0 times
...
Sean
8 days ago
So the correct answer is B) 2 test cases.
upvoted 0 times
...
Charlene
30 days ago
That's right, one for 'female' and one for 'male'.
upvoted 0 times
...
Nohemi
1 months ago
You only need 2 test cases to achieve 100% decision coverage.
upvoted 0 times
...
...
Dannie
2 months ago
I think we need 3 test cases to achieve 100% decision coverage.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77