Independence Day Deal! Unlock 25% OFF Today – Limited-Time Offer - 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
1 months 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
1 months 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
17 days ago
True, this question is pretty straightforward. Just need to cover both branches of the if-else statement.
upvoted 0 times
...
...
Rodolfo
2 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
Michael
10 days ago
I agree, visualizing the paths might make it easier to determine the number of test cases needed.
upvoted 0 times
...
Serina
14 days ago
I think creating a decision tree is a good idea. It will help you see all the paths clearly.
upvoted 0 times
...
Lavonna
16 days ago
You could also try creating truth tables to see all the possible combinations.
upvoted 0 times
...
...
Louis
2 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
Lavina
7 days ago
That makes sense. It's important to cover all possible paths in the code.
upvoted 0 times
...
Tasia
10 days ago
So, we only need 2 test cases to achieve 100 per cent decision coverage.
upvoted 0 times
...
Theodora
14 days ago
Yes, you are correct. We just need to test both outcomes of the gender check.
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
18 days ago
Thanks for the clarification!
upvoted 0 times
...
Sean
24 days ago
So the correct answer is B) 2 test cases.
upvoted 0 times
...
Charlene
2 months ago
That's right, one for 'female' and one for 'male'.
upvoted 0 times
...
Nohemi
2 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