ExamGecko
Question list
Search
Search

Related questions











Question 356 - CTFL-2018 discussion

Report
Export

Which of the following statements is true?

A.
100% branch coverage means 100% statement coverage.
Answers
A.
100% branch coverage means 100% statement coverage.
B.
100% statement coverage means 100% branch coverage.
Answers
B.
100% statement coverage means 100% branch coverage.
C.
100% branch coverage means 100% statement coverage and vice-versa.
Answers
C.
100% branch coverage means 100% statement coverage and vice-versa.
D.
It is impossible to achieve 100% statement coverage
Answers
D.
It is impossible to achieve 100% statement coverage
Suggested answer: A

Explanation:

100% branch coverage means 100% statement coverage, but not vice-versa. Branch coverage is a stronger criterion than statement coverage, as it requires that every possible outcome of each decision point is executed at least once.Statement coverage only requires that every executable statement is executed at least once1explains this as follows:

Branch Coverage (also known as Decision Coverage) measures which possible branches in flow control structures are followed. Branch Coverage is a testing method, which aims to ensure that each one of the possible branch from each decision point is executed at least once and thereby ensuring that all reachable code is executed.

Statement Coverage measures the number of statements in the source code that are executed during the test. Statement Coverage is a metric, which is used to calculate and measure the number of statements in the source code which have been executed during testing.

B, C, and D are false statements. 100% statement coverage does not mean 100% branch coverage (B), as there may be some branches that are not covered by the test cases. 100% branch coverage does not mean 100% statement coverage and vice-versa , as branch coverage implies statement coverage but not the other way around. It is possible to achieve 100% statement coverage (D), but it may not be feasible or cost-effective for some systems.

asked 18/09/2024
Yan Wei
35 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first