ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 104 - CTFL4 discussion

Report
Export

During component testing of a program if 100% decision coverage is achieved, which of the following coverage criteria is also guaranteed to be 100%?

A.
100% Stale transition coverage
Answers
A.
100% Stale transition coverage
B.
100% Equivalence class coverage
Answers
B.
100% Equivalence class coverage
C.
100% Boundary value coverage
Answers
C.
100% Boundary value coverage
D.
100% Statement coverage
Answers
D.
100% Statement coverage
Suggested answer: D

Explanation:

Statement coverage is a structural coverage metric that measures the percentage of executable statements in the source code that are executed by a test suite1.Decision coverage is another structural coverage metric that measures the percentage of decision outcomes (such as branches or conditions) in the source code that are executed by a test suite1.Decision coverage is a stronger metric than statement coverage, because it requires that every possible outcome of each decision is tested, while statement coverage only requires that every statement is executed at least once2. Therefore, if a test suite achieves 100% decision coverage, it also implies that it achieves 100% statement coverage, because every statement in every branch or condition must have been executed.However, the converse is not true: 100% statement coverage does not guarantee 100% decision coverage, because some branches or conditions may have multiple outcomes that are not tested by the test suite2. For example, consider the following pseudocode:

if (x > 0) then print(''Positive'') else print(''Non-positive'') end if

A test suite that executes this code with x = 1 and x = -1 will achieve 100% statement coverage, because both print statements are executed. However, it will not achieve 100% decision coverage, because the condition x > 0 has only been tested with two outcomes: true and false. The third possible outcome, x = 0, has not been tested by the test suite. Therefore, the test suite may miss a potential bug or error in the condition or the branch.

The other options, such as stale transition coverage, equivalence class coverage, and boundary value coverage, are not guaranteed to be 100% by achieving 100% decision coverage.Stale transition coverage is a structural coverage metric that measures the percentage of transitions between states in a state machine that are executed by a test suite3.Equivalence class coverage is a functional coverage metric that measures the percentage of equivalence classes (or partitions) of input or output values that are tested by a test suite4.Boundary value coverage is another functional coverage metric that measures the percentage of boundary values (or extreme values) of input or output ranges that are tested by a test suite4. These metrics are independent of decision coverage, because they are based on different aspects of the system under test, such as its behavior, functionality, or specification. Therefore, achieving 100% decision coverage does not imply achieving 100% of any of these metrics, and vice versa.Reference=ISTQB Certified Tester Foundation Level Syllabus v4.0,Test Coverage in Software Testing - Guru99,Structural Coverage Metrics - MATLAB & Simulink - MathWorks India,Test Design Coverage in Software Testing - GeeksforGeeks.

asked 18/09/2024
Han Valk
46 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first