State Transition Testing – Valid Transitions Coverage
1. Introduction
In the ISTQB Foundation Level syllabus, state transition testing is a black-box technique used when system behavior depends on states and events.
A common coverage target is valid transitions coverage, meaning the test cases should execute as many different valid state changes as possible.
ISTQB의 상태 전이 테스트(State transition testing)는 상태(state)와 이벤트(event)에 따라 시스템 동작이 달라질 때 사용하는 블랙박스 기법입니다.
이 문제는 가능한 한 많은 유효 전이(valid transitions)를 실행하도록 이벤트 시퀀스를 고르는 문제입니다.
2. Practice Question
❓ Question
You are applying state transition testing to a hotel room reservation system modeled by the following state transition table (4 states, 5 events). All test cases start in the Requesting state.
| State | Available | NotAvailable | ChangeRoom | Cancel | Pay |
|---|---|---|---|---|---|
| S1: Requesting | S2 | S3 | - | - | - |
| S2: Confirmed | - | - | S1 | S4 | S4 |
| S3: Waiting list | S2 | - | - | S4 | - |
| S4: End | - | - | - | - | - |
Which test case (sequence of events) achieves the highest valid transitions coverage?
- a) NotAvailable, Available, ChangeRoom, NotAvailable, Cancel
- b) Available, ChangeRoom, NotAvailable, Available, Pay
- c) Available, ChangeRoom, Available, ChangeRoom, NotAvailable
- d) NotAvailable, Cancel, ChangeRoom, Available, Pay
✅ Correct Answer: b)
3. Explanation
Step 1: List the valid transitions
From the table, the valid transitions are:
- S1 --Available--> S2
- S1 --NotAvailable--> S3
- S2 --ChangeRoom--> S1
- S2 --Cancel--> S4
- S2 --Pay--> S4
- S3 --Available--> S2
- S3 --Cancel--> S4
유효 전이는 총 7개입니다:
- S1→S2 (Available)
- S1→S3 (NotAvailable)
- S2→S1 (ChangeRoom)
- S2→S4 (Cancel)
- S2→S4 (Pay)
- S3→S2 (Available)
- S3→S4 (Cancel)
✔ b) Available, ChangeRoom, NotAvailable, Available, Pay — Correct
Start at S1 (Requesting) and follow the events:
- Available: S1 → S2
- ChangeRoom: S2 → S1
- NotAvailable: S1 → S3
- Available: S3 → S2
- Pay: S2 → S4
This single test case covers 5 different valid transitions:
- S1→S2 (Available)
- S2→S1 (ChangeRoom)
- S1→S3 (NotAvailable)
- S3→S2 (Available)
- S2→S4 (Pay)
So it achieves the highest valid transitions coverage (5 out of 7).
b는 한 번의 시퀀스로 서로 다른 유효 전이 5개를 실행하므로 가장 높은 유효 전이 커버리지(5/7)를 달성합니다.
Why the other options are not the best
❌ a) NotAvailable, Available, ChangeRoom, NotAvailable, Cancel
This sequence repeats the same transition for both NotAvailable events (S1→S3), so it covers only 4 distinct valid transitions.
NotAvailable가 두 번 모두 S1→S3 전이로 중복되어 서로 다른 전이는 4개만 커버합니다.
❌ c) Available, ChangeRoom, Available, ChangeRoom, NotAvailable
This repeats Available (S1→S2) and ChangeRoom (S2→S1), resulting in only 3 distinct valid transitions.
Available과 ChangeRoom 전이가 반복되어 서로 다른 전이는 3개 수준입니다.
❌ d) NotAvailable, Cancel, ChangeRoom, Available, Pay
After NotAvailable: S1→S3, and then Cancel: S3→S4 (End). Once the system reaches S4 (End), no further valid transitions are possible.
Cancel 이후 S4(End)에 도달하면 추가 전이가 불가능하므로 해당 시퀀스는 끝까지 실행 가능한 테스트 케이스가 아닙니다.
4. Summary Table
| Option | Feasible? | Distinct Valid Transitions Covered | Coverage | 결론 |
|---|---|---|---|---|
| a | Yes | 4 | 4/7 | 중복 존재 |
| b | Yes | 5 | 5/7 | 정답 |
| c | Yes | 3 | 3/7 | 중복 많음 |
| d | No | 2 (then stops) | - | End 도달 |
5. Final Takeaway
For the ISTQB exam, remember:
In state transition testing, the best test case for valid transitions coverage is the feasible event sequence that covers the highest number of distinct valid transitions.
시험 대비 핵심 문장입니다.
상태 전이 테스트에서 유효 전이 커버리지는 실행 가능한 이벤트 시퀀스 중 서로 다른 유효 전이를 가장 많이 포함하는 것을 선택한다.
Related: More ISTQB Posts | Next Question