ExamGecko
Question list
Search
Search

Related questions











Question 254 - CTFL-2018 discussion

Report
Export

Consider the following Pseudo code:

How many minimum lea cases are required to cover 100% Statement coverage and Decision coverage?

A.
1 for Statement. 5 for Decision
Answers
A.
1 for Statement. 5 for Decision
B.
1 for Statement. 2 for Decision
Answers
B.
1 for Statement. 2 for Decision
C.
5 for Statement. 1 for Decision
Answers
C.
5 for Statement. 1 for Decision
D.
2 for Statement, 5 for Decision
Answers
D.
2 for Statement, 5 for Decision
Suggested answer: B

Explanation:

To achieve 100% statement coverage, we need to execute every statement in the code at least once. To achieve 100% decision coverage, we need to execute every possible outcome of every decision in the code at least once. In this case, we can use the following test cases to cover both statement and decision coverage:

A = true, B = true

A = false, B = false

These two test cases will cover all the statements and all the possible outcomes of the decisions in the code. Therefore, the minimum number of test cases required to achieve both statement and decision coverage is two.

asked 18/09/2024
Maurizio Toniato
31 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first