State tables, N-switch coverage and loops
Testing every single move in a state model is a start. N-switch coverage tests chains of moves, and a loop needs a cap so the count stays finite.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: two-step journeys on a metro map. You can count the single hops between stations. Or you can count the two-step journeys, where you ride one line and then change to another. There are more journeys than hops, and some faults only show when you change lines.
Daily List is a to-do list app. A task is open, done or archived. Tom, the tester, has covered each single move at least once. He now asks what happens when one move follows straight after another.
Covering every chain of N plus one moves in a state model is called . A is two or more transitions taken one straight after another. Covering every single move is 0-switch coverage, and covering every pair of moves in a row is 1-switch coverage.
A task can also be edited again and again, and that move returns to the same state. A run of moves that leaves a state and comes back to it is a .
The picture has a limit. A metro map is fixed. A state model can be wrong, and a real product may allow moves the model does not show.
(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)
PLAIN WORDS · 1 in this section
- hops
- single steps of a message's trip between machines
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.
THE REAL JOB Counting chains of moves in a state model and testing the ones that matter, with loops capped.
- One hop
- Two hops
- Cap the circle
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| A metro map | The state model |
| A single hop | One move, zero-switch |
| A two-step journey | A chain of two, one-switch |
| A circle line | A state loop |
WHERE THIS PICTURE STOPS
- A map is fixed. A model can be wrong.
- A traveller picks a journey. A tester must cover chains on purpose.
- A circle line is easy to see. A loop in a model may hide in a single move.
HOOK
One hop, two hops, cap the circle.
REMEMBER IT THIS WAY
A chunk: a long list grouped so it is easier to hold.
Single hop, pair of hops, cap the circle: single moves first, then every pair of moves in a row, and loops get a cap.
| In the trick | What it stands for |
|---|---|
| Single hop | Covering every single move |
| Pair of hops | Covering every pair of moves in a row |
| Cap | A limit on how often a run of moves returns to the same state |
TELL A FRIEND
counts journeys on a metro map: single hops, two-step journeys, and so on, with the circle line capped.
OFTEN MIXED UP WITH State transition coverage: states, transitions and paths. The lesson names the first two levels of switch coverage in passing. This lesson builds the table and counts the chains.
PRACTISE AND KEEP
Sources for this topic — 7 sources
- Market practice
State transition testing (Test Management Approach (TMAP) wiki) ↗ — Test Management Approach (TMAP) site · 0-switch coverage means every single valid transition is exercised, and 1-switch coverage covers pairs of consecutive transitions; higher levels extend the idea (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
state transition test design (Tessl registry page) ↗ — Tessl · Higher switch levels are warranted only for high-risk flows because the count grows quickly with N; an unofficial page citing the advanced syllabus (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Testing Software Design Modeled by Finite-State Machines (T. S. Chow, IEEE Transactions on Software Engineering, 1978) ↗ — Institute of Electrical and Electronics Engineers (IEEE) · The 1978 paper proposes a testing strategy for designs modelled as finite-state machines, built on n-switch set covers (search excerpt of the abstract, full text not seen)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: IEEE Transactions on Software Engineering, vol. SE-4, no. 3, 1978. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Unified Modeling Language (UML) 2 tutorial, state machine diagram (Sparx Systems) ↗ — Sparx Systems · A tutorial on state machine diagrams: states, transitions with a trigger, a guard and an effect (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
ISTQB Advanced Level Test Analyst Syllabus ↗ — International Software Testing Qualifications Board (ISTQB) · Mirror copy of the publisher PDF (ISTQB syllabus CTAL-TA v4.0 GA, 2 May 2025), version checked against the document's own front matter, read in full text: section 3.2.2 (TA-3.2.2, K3): N-switch coverage counts valid sequences of N+1 consecutive transitions; 0-switch equals valid transitions coverage; a 1-switch is a pair of incoming and outgoing transitions at a state; 2-switch or higher is for a high risk of unexpected sequences. Section 3.2.3 adds simple loop coverage for scenario models with loops
Text read in full from a mirror copy of the publisher PDF (ISTQB syllabus CTAL-TA v4.0 GA, 2 May 2025), version checked against the document's own front matter. The page at this URL was not opened. Licence terms were not read, so put it in your own words and do not quote it.
- Market practice
Test analysis and design: N-switch coverage (Software Test Pilot study page) ↗ — Software Test Pilot · N-switch coverage is the share of sequences of N plus one transitions that a test suite has exercised (search excerpt, page not opened). The round-trip definition, a loop whose start and end states are the same with no other state occurring twice, is confirmed by section 3.2.2 of the Test Analyst syllabus v4.0 GA, read in full text from a mirror copy
Found through a web search; the page was not opened (search excerpt, page not opened). Study page, not the glossary itself. The glossary entry for round-trip coverage was not found. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Certified Tester Advanced Level Test Analyst (CTAL-TA) Syllabus v4.0 ↗ — US member board of the International Software Testing Qualifications Board · Mirror copy of the publisher PDF (ISTQB syllabus CTAL-TA v4.0 GA, 2 May 2025), version checked against the document's own front matter, read in full text: section 3.2.2 (TA-3.2.2, K3) state transition testing adds N-switch coverage and round-trip coverage to the criteria in the Foundation syllabus
Text read in full from a mirror copy of the publisher PDF (ISTQB syllabus CTAL-TA v4.0 GA, 2 May 2025), version checked against the document's own front matter. The page at this URL was not opened. Licence terms were not read, so put it in your own words and do not quote it.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.