111k views
4 votes
Consider the following state transition diagram for a credit-card only, unattended gasoline pump:

Assume that you want to develop the minimum number of tests to cover each transition in the state transition diagram. Assume further that each test must start at the beginning state, waiting for customer, and each test ends when a transition arrives at the beginning state. How many tests do you need?
A. 4
B. 7
C. 1
D. Infinite

User Vanetta
by
8.2k points

1 Answer

7 votes

Final answer:

To cover each transition in the state transition diagram, you would need 7 tests. Option b

Step-by-step explanation:

In this state transition diagram, there are six distinct states along with transitions between these states. The goal is to create tests that cover every transition starting from the initial state and ending at the initial state. From the given diagram, the transitions are Waiting for customer → Pumping gas, Pumping gas → Waiting for customer, Waiting for customer → Unauthorized, Unauthorized → Waiting for customer, Unauthorized → Pumping gas, and Pumping gas → Authorized. By traversing these transitions in different combinations, 7 tests can be created to cover each transition once. Each test starts at the initial state, Waiting for customer, and ends at the same state after covering different transitions. Therefore, to ensure that each transition is tested at least once, 7 distinct tests are required.

The state transition diagram outlines the various possible states and the transitions between them. For comprehensive testing coverage, it's essential to execute tests that encompass each possible transition, starting and ending at the initial state. The tests are designed to explore the system's behavior and ensure that each potential transition path is evaluated, which in this case requires 7 distinct tests to cover every transition in the state diagram. This approach facilitates a thorough assessment of the system's functionality and validates its behavior across different states and transition scenarios, ensuring robustness and reliability in the gasoline pump system.Option b

User Makah
by
7.4k points