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?
Ans: B. Decision coverage = minimum number of test cases to cover all branches. In this case, there is only one if-else statement, which means that 2 test cases are required.
Note that if they asked for 100% statement coverage, it would still be 2, because the "Dear" statement would be covered by both test cases.
1. Verify that "Dear" is displayed
2. Verify that "Ms." is displayed if gender is Female
3. Verify that "Mr." is displayed if gender is Male
upvoted 3 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
laraerf
1 year, 7 months agoShoxybee99
2 years, 5 months agoSivajiTheBoss
2 years, 6 months agosubwaysandwich
3 years, 1 month agosubwaysandwich
3 years, 1 month agosubwaysandwich
3 years, 1 month agoArcino12
4 years ago