ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 48 - CTAL-TTA discussion

Report
Export

Consider the pseudo code provided below:

Which of the following options provides a set of test cases that achieves 100% decision coverage for this code fragment, with the minimum number of test cases?

Assume that in the options, each of the three numbers in parenthesis represent the inputs for a test case, where the first number represents variable ''a'', the second number represents variable ''b'', and the third number represents variable ''c''.

A.
(5. 3,2)
Answers
A.
(5. 3,2)
B.
(5. 3, 2); (6, 4, 2); (5, 4, 0)
Answers
B.
(5. 3, 2); (6, 4, 2); (5, 4, 0)
C.
(5. 4, 0); (3, 2, 5); (4, 5, 0)
Answers
C.
(5. 4, 0); (3, 2, 5); (4, 5, 0)
D.
(4,5. 0); {5, 4, 5)
Answers
D.
(4,5. 0); {5, 4, 5)
Suggested answer: B

Explanation:

To achieve 100% decision coverage with the minimum number of test cases, we need to ensure that every branch of the decision is taken at least once. For the code provided:

The first condition (a>b) is true for the first two test cases and false for the third.

The second condition (b>c) is true for the first test case, false for the second, and does not matter for the third since the first condition is false.

Therefore, with these three test cases, we cover all possible outcomes of the decision, ensuring 100% decision coverage.

asked 18/09/2024
Martijn Pollmann
36 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first