Consider the following: Pick up and read the newspaper Look at what is on television If there is a program that you are interested in watching then switch the television on and watch the program Otherwise Continue reading the newspaper If there is a crossword in the newspaper then try and complete the crossword
-
SC = 1 and DC = 2
-
SC = 1 and DC = 3
-
SC = 2 and DC = 2
-
SC = 2 and DC = 3
Explanation: This scenario describes a simple decision-making process, where the person decides whether to watch TV or read the newspaper based on the availability of an interesting program and a crossword puzzle.
The steps in the process can be numbered as follows:
- Pick up and read the newspaper
- Look at what is on television
- If there is a program that you are interested in watching then switch the television on and watch the program
- Otherwise, continue reading the newspaper
- If there is a crossword in the newspaper then try and complete the crossword
The starting point is step 1, which is always executed. Then, depending on the situation, either step 3 or 4 is executed, but not both. Finally, step 5 is executed if there is a crossword puzzle in the newspaper.
Therefore, the structure chart for this scenario can be represented as follows:
+-----------+
| Start |
+-----------+
|
|
+-----------+
| Read news |
+-----------+
|
|
+-----------+
| Look TV |
+-----------+
/ \
/ \
+-----------+ +----------------+
| Watch | | Continue |
| program | | reading |
+-----------+ | newspaper |
+----------------+
|
|
+----------------+
| Try crossword |
+----------------+
As seen from the structure chart, there are two selection criteria (SC) and three decision criteria (DC).
The selection criteria are:
- SC1: Is there an interesting program on TV?
- SC2: If there is no interesting program on TV, continue reading the newspaper.
The decision criteria are:
- DC1: Watch the program.
- DC2: Continue reading the newspaper.
- DC3: Try to complete the crossword.
Therefore, the correct answer is D) SC = 2 and DC = 3.
This is a classic ISTQB Foundation-level sample exam question on statement coverage (SC) versus decision coverage (DC). The pseudocode has one nested structure: an outer IF (interesting program? watch it) with an implicit else (keep reading), and inside that else branch, an inner IF (has crossword? do it). To achieve 100% Statement Coverage, you need 2 test cases: one path exercising the 'watch program' branch, and one exercising the 'read newspaper + do crossword' branch — covering every statement at least once. To achieve 100% Decision Coverage, you need every branch (both true and false outcomes) of both IF statements exercised, which requires 3 test cases, since the two decisions can't both be covered on both sides with only 2 paths. Hence SC = 2, DC = 3.