graph TD
accTitle: Gym entry gate flowchart
accDescr: An invalid card is rejected. A valid card outside opening hours gets Closed. A valid card during opening hours gets Welcome when the fee is paid and Pay at desk otherwise.
A((Start)) --> B[/"<i>card_valid</i>, <i>has_paid</i>, <i>hour</i>"/]
B --> C{"Is <i>card_valid</i><br>True?"}
C -- No --> R[/"Rejected"/]
C -- Yes --> D{"Is 6 <= <i>hour</i><br>< 23?"}
D -- No --> K[/"Closed"/]
D -- Yes --> E{"Is <i>has_paid</i><br>True?"}
E -- No --> P[/"Pay at desk"/]
E -- Yes --> W[/"Welcome"/]
R --> Z((End))
K --> Z
P --> Z
W --> Z
M6) Gym entry gate
A university gym opens its entry gate with a member card. The gate first checks that the card is valid, then that the gym is open, and finally that this month’s fee has been paid. The gym is open from 6:00 until 23:00, so the hour hour of arrival must satisfy 6 ≤ hour < 23. Figure 1 shows the decision.
A tester wants a test set that makes every Yes arrow and every No arrow of the 3 decisions run at least once. Table 1 lists 4 candidate test sets. Each test case is written as (card_valid, has_paid, hour).
| Set | Test cases |
|---|---|
| 1 | (True, True, 10), (False, True, 10), (True, False, 10) |
| 2 | (True, True, 10), (False, False, 3), (True, True, 23), (True, False, 6) |
| 3 | (True, True, 6), (True, True, 22), (True, False, 12), (False, True, 12) |
| 4 | (False, True, 10), (False, False, 3), (True, True, 23), (True, False, 23) |