Testland
Browse all skills & agents

state-transition-test-design

Derives human-readable manual test cases from stateful behavior: identify states, events, transitions, and guard conditions, draw the state table including invalid (empty-cell) transitions, choose a coverage level (all states, valid transitions / 0-switch, transition pairs / 1-switch per Chow, all transitions including invalid ones), then derive one test case per coverage item as an event sequence with per-step expected states (ISTQB CTFL v4.0 section 4.2.4). A deep single-technique walkthrough rather than a broad multi-lens case matrix; the output is manual step/expected cases rather than parameterized test code, and it covers how cases are derived rather than how a case record is structured. Use for lifecycle entities (accounts, orders, subscriptions), workflows, and UI wizards where the response to an event depends on the current state.

Install with skills.sh (any agent)

npx skills add testland/qa --skill state-transition-test-design
View source

state-transition-test-design

Overview

Per ISTQB CTFL Syllabus v4.0.1 §4.2.4 (opens in new window), "a state diagram models the behavior of a system by showing its possible states and valid state transitions. A transition is initiated by an event, which may be additionally qualified by a guard condition." This skill walks the derivation end to end: stateful spec in, human-readable manual test cases out (event sequences with per-step expected states, not code).

CTFL claims below come from the official v4.0.1 PDF (2024-09-15) fetched from istqb.org on 2026-06-10; the N-switch material comes from the CTAL-TA v4.0 syllabus §3.2.2 (opens in new window) (fetched 2026-06-10). One worked example (account lockout) is carried through every step.

When to use

State transition testing fits wherever "the reaction of the system to an event depends on the current state of the system" - the CTAL-TA syllabus names "embedded systems, dialog-based systems, control systems, or systems that deal with entities and their lifecycles" as canonical stateful systems (CTAL-TA v4.0 §3.2.2 (opens in new window)). In web/product QA that means:

  • Lifecycle entities: accounts, orders, subscriptions, tickets, documents with draft/review/published states.
  • Workflows: approval chains, payment flows, onboarding.
  • UI wizards: multi-step forms where back/skip/cancel behavior depends on the current step.

If behavior is stateless rule logic (same input always gives the same output), use decision-table-test-design instead. For a broad multi-lens first pass over a story, use test-case-ideation-from-story (in the qa-process plugin); this skill is the deep walkthrough of one technique.

Worked example spec (used in every step)

Account lockout. An Active account locks after the 3rd consecutive failed login (a lockout email is sent); a successful login resets the failure counter. An admin can unlock a Locked account (counter resets), suspend an Active account, reinstate a Suspended account, and close an Active, Locked, or Suspended account. Closed is terminal. Locked and Suspended accounts reject all logins.

Step 1 - Identify states, events, transitions, guards

§4.2.4 gives the transition labeling syntax event [guard condition] / action, where "guard conditions and actions can be omitted if they do not exist or are irrelevant for the tester" (CTFL v4.0.1 (opens in new window)).

States (4): Active, Locked, Suspended, Closed.

Events (6, counting guarded variants separately): login-success, login-fail [fails < 3], login-fail [3rd consecutive], admin-unlock, admin-suspend, admin-close. The same raw event (login-fail) splits into two columns because its guard changes the target state; per §4.2.4 the table columns are "events (together with guard conditions if they exist)".

Valid transitions (9):

IDFromLabelTo
t1Activelogin-success / reset fail counterActive
t2Activelogin-fail [fails < 3] / increment counterActive
t3Activelogin-fail [3rd consecutive] / send lockout emailLocked
t4Activeadmin-suspendSuspended
t5Activeadmin-closeClosed
t6Lockedadmin-unlock / reset fail counterActive
t7Lockedadmin-closeClosed
t8Suspendedadmin-unlockActive
t9Suspendedadmin-closeClosed

This table doubles as the state diagram in markdown form: every row is one labeled arrow.

Step 2 - Draw the state table (states x events, invalid cells included)

Per §4.2.4, "a state table is a model equivalent to a state diagram. Its rows represent states, and its columns represent events... Table entries (cells) represent transitions, and contain the target state, as well as the resulting actions, if defined. In contrast to the state diagram, the state table explicitly shows invalid transitions, which are represented by empty cells" (CTFL v4.0.1 (opens in new window)).

Empty cells are marked -- below for readability:

State \ Eventlogin-successlogin-fail [fails < 3]login-fail [3rd]admin-unlockadmin-suspendadmin-close
ActiveActive / reset (t1)Active / increment (t2)Locked / email (t3)--Suspended (t4)Closed (t5)
Locked------Active / reset (t6)--Closed (t7)
Suspended------Active (t8)--Closed (t9)
Closed------------

Count: 4 states x 6 event columns = 24 cells; 9 valid transitions, 15 invalid. "Invalid" means the model defines no state change for that event in that state, not that the event cannot physically arrive: a user can type correct credentials into a Locked account (row Locked, column login-success); the system must reject the login and stay Locked. Those cells are exactly where lockout-bypass bugs live.

Step 3 - Choose the coverage level

§4.2.4 defines three criteria (CTFL v4.0.1 (opens in new window)):

LevelCoverage items100% meansHere
All statesThe statesEvery state exercised4 items
Valid transitions (0-switch)Single valid transitionsEvery valid transition exercised9 items
All transitionsAll cells of the state tableAll valid exercised + all invalid attempted24 items

Per the same section: "all states coverage is weaker than valid transitions coverage", "valid transitions coverage is the most widely used coverage criterion" and guarantees all states coverage, and "all transitions coverage... should be a minimum requirement for mission and safety-critical software." Coverage for each is the exercised (or attempted) items divided by total items, as a percentage.

Transition pairs (1-switch, Chow). Beyond CTFL, "N-switch coverage applies to valid sequences of N+1 consecutive transitions, also called N-switches (Chow, 1978). 0-switch coverage equals the valid transitions coverage... A 1-switch is a pair of incoming and outgoing transitions at a state. 0- and 1-switch coverage are frequently used in practice"; 100% 2-switch or higher "is only indicated for a high risk of failure due to unexpected sequences of events, as the number of N-switches can grow exponentially with N" (CTAL-TA v4.0 §3.2.2 (opens in new window)).

Practical default: valid-transitions (0-switch) coverage plus targeted invalid-transition tests for the security/abuse-relevant empty cells; escalate to 1-switch pairs around states whose exit behavior depends on how they were entered.

Step 4 - Derive test cases (valid-transitions coverage)

Per §4.2.4, "a test case based on a state diagram or state table is usually represented as a sequence of events" and "one test case may, and usually will, cover several transitions between states" (CTFL v4.0.1 (opens in new window)). Three event sequences cover all 9 valid transitions (9/9 = 100% valid-transitions coverage):

TC-ST-1 (covers t1, t2, t3, t6, t4, t9). Precondition: Active account, failure counter 0, valid + invalid passwords known.

#ActionExpected result
1Log in with the correct passwordLogin succeeds; account Active (t1)
2Log out, then attempt login with a wrong passwordLogin rejected; account still Active (t2)
3Attempt login with a wrong password againLogin rejected; account still Active (t2)
4Attempt login with a wrong password a 3rd consecutive timeLogin rejected; account shows Locked in admin panel; lockout email received (t3)
5As admin, unlock the accountAccount Active (t6)
6As admin, suspend the accountAccount Suspended (t4)
7As admin, close the accountAccount Closed (t9)

TC-ST-2 (covers t7). Precondition: Active account, counter 0.

#ActionExpected result
1Attempt login with a wrong password 3 timesAccount Locked; lockout email received
2As admin, close the locked accountAccount Closed (t7)

TC-ST-3 (covers t8, t5). Preconditions: two Active accounts.

#ActionExpected result
1As admin, suspend account AAccount A Suspended
2As admin, reinstate (unlock) account AAccount A Active (t8)
3As admin, close account B directly from ActiveAccount B Closed (t5)

Every step asserts the resulting observable state (admin-panel status, login response, email), never just "action accepted". Expand each into a full runnable script via manual-test-script-author.

Step 5 - Add invalid-transition tests

For all-transitions coverage, §4.2.4 requires that test cases "exercise all the valid transitions and attempt to execute invalid transitions", and warns: "testing only one invalid transition in a single test case helps to avoid defect masking, i.e., a situation in which one defect prevents the detection of another" (CTFL v4.0.1 (opens in new window)). So: one empty cell per test case. The two highest-risk cells here:

TC-INV-1 (Locked + login-success). Precondition: account Locked.

#ActionExpected result
1Attempt login with the correct passwordLogin rejected with an account-locked message; account remains Locked; no session created

TC-INV-2 (Closed + admin-unlock). Precondition: account Closed.

#ActionExpected result
1As admin, attempt to unlock the closed accountOperation rejected or not offered; account remains Closed

Full all-transitions coverage means attempting all 15 empty cells (24/24 items). At minimum, cover every empty cell in rows reachable by end users (Locked, Closed) - those are the abuse paths.

Why 1-switch catches what 0-switch misses

TC-ST-1 through TC-ST-3 reach 100% valid-transitions coverage, yet never execute the transition pair (t6 admin-unlock, then t2 login-fail). If the unlock handler forgets to reset the failure counter, one wrong password after an unlock immediately re-locks the account - a real defect that 0-switch coverage cannot see, because t6 and t2 were each exercised, just never consecutively. A 1-switch is exactly this "pair of incoming and outgoing transitions at a state" (CTAL-TA v4.0 §3.2.2 (opens in new window)). Add:

TC-SW-1 (pair t6 then t2). Lock the account (3 failed logins), admin unlocks, then attempt one wrong-password login. Expected: login rejected, account remains Active (counter restarted at 0, not 3).

Anti-patterns

Anti-patternWhy it failsFix
Only testing the happy path through the machineOne pass touches a few transitions; here a single Active to Closed walk covers 4 of 9 valid transitions and 0 invalid onesPick an explicit coverage level (Step 3) and derive per coverage item
Ignoring invalid-event behaviorThe empty cells are where lockout bypasses and zombie-state bugs live; §4.2.4 makes them explicit coverage items in all-transitions coverageAt least the user-reachable empty cells get a TC each (Step 5)
Bundling several invalid transitions in one TC§4.2.4: one invalid transition per test case avoids defect maskingSplit: one empty cell per TC
Stopping at all-states coverage§4.2.4 calls it weaker than valid-transitions coverage; one walk can satisfy it while skipping most transitionsUse valid-transitions (0-switch) as the floor
Merging guarded variants into one event columnThe 3rd login-fail has a different target state than the 1st; one column hides t3Split columns per guard (Step 1)
Modeling implementation states (DB flags) instead of spec statesThe model stops matching observable behavior; expected results become unverifiable for a manual testerStates must be distinguishable through the UI/API the tester can observe

Limitations

  • Model quality bounds test quality. The technique only finds defects the state model can express; a missing state in the model is invisible to every coverage level.
  • Transitions are modeled as instantaneous (§4.2.4: "the transitions are assumed to be instantaneous"). Races mid-transition (two admins acting at once) need concurrency testing, not this technique.
  • N-switch explodes. Per CTAL-TA §3.2.2 the number of N-switches grows exponentially with N; reserve 2-switch+ for high-risk machines.
  • Stateless logic does not belong here. Pure input-combination rules go to decision-table-test-design.

References

  • ISTQB CTFL Syllabus v4.0.1, §4.2.4 State Transition Testing - istqb.org PDF (opens in new window) (official syllabus, fetched 2026-06-10; CTFL quotes above are from this section).
  • ISTQB CTAL-TA Syllabus v4.0, §3.2.2 State Transition Testing - astqb.org PDF (opens in new window) (N-switch / Chow 1978 / round-trip coverage; fetched 2026-06-10). Chow T.S. (1978), "Testing Software Design Modeled by Finite-State Machines", is cited here via the CTAL-TA syllabus.
  • ISTQB Glossary terms "state transition testing" and "N-switch coverage" exist at glossary.istqb.org but the site blocks non-browser fetches; cite the syllabus sections above as the stable sources.
  • Siblings: decision-table-test-design (stateless rule logic), manual-test-script-author (expands derived cases into runnable scripts).
  • Neighbors this skill is distinct from: test-case-ideation-from-story, boundary-value-generator, test-case-anatomy-reference.

Related skills

bug-bash-facilitator

Builds a structured bug-bash session - pre-bash kit (charter, test-data prep, environment setup, sign-up sheet), in-bash structure (role rotation across cohorts, shared backlog board, real-time triage), scoring rubric (severity weighting, novelty bonus), and a post-bash same-day wrap-up authored by the facilitator (not a standalone debrief: for post-session writeups without a live bash, use manual-test-debrief). Use when a team needs a coordinated multi-tester sweep before a release or after a major change - converts an ad-hoc "everyone test for an hour" into a recorded, comparable session with deliverables.

crusspic-stmpl-heuristic

Pure-reference catalog of James Bach's CRUSSPIC STMPL heuristic - thirteen quality criteria (quality attributes / non-functional requirements) a tester can evaluate a system against. CRUSSPIC: Capability, Reliability, Usability, Security, Scalability, Performance, Installability, Compatibility. STMPL: Supportability, Testability, Maintainability, Portability, Localizability. Use when checking a product's quality attributes or non-functional requirements, or picking which quality characteristics a test session evaluates - a checklist for judging product quality holistically; complementary to the ISO/IEC 25010 software product-quality model.

decision-table-test-design

Derives human-readable manual test cases from a business-rule spec via a decision table: identify conditions and actions, build the full 2^n-column matrix, collapse columns with irrelevant entries, strike infeasible combinations, then emit one test case per remaining column (each feasible column is one coverage item per ISTQB CTFL v4.0 section 4.2.3). A deep single-technique walkthrough rather than a broad multi-lens case matrix; the output is manual step/expected cases rather than parameterized test code, and it covers how cases are derived rather than how a case record is structured. Use when a spec's outcome depends on interacting conditions (pricing, eligibility, discounts, routing rules) rather than the boundaries of a single input.

exploratory-tours-reference

Pure-reference catalog of the seven exploratory testing tours from Whittaker's Exploratory Software Testing (2009): Feature, Money, Landmark, Intellectual, Bad-data, Configuration, and Garbage-collector's, each a themed mission with the signal it surfaces and a worked example. Use as the menu a charter author picks session themes from. Distinct from the mnemonic catalogs sfdpot-exploratory-heuristic (what to vary) and hiccupps-f-heuristic (oracles), and from session-based-test-management-reference, which manages the sessions.

fcc-cuts-vids-heuristic

Pure-reference catalog of Michael Kelly's FCC CUTS VIDS touring heuristic (2005): eleven tours - Feature, Complexity, Claims, Configuration, User, Testability, Scenario, Variability, Interoperability, Data, Structure - each a reconnaissance sweep that builds familiarity with an unfamiliar application. Use when onboarding onto a product or opening a first session on an unknown area, before a charter is scoped. Distinct from exploratory-tours-reference (Whittaker's seven tours, which frame a bug-hunting mission on a product the tester already knows), sfdpot-exploratory-heuristic (what to vary), hiccupps-f-heuristic (oracles), and crusspic-stmpl-heuristic (quality criteria).

hiccupps-f-heuristic

Pure-reference catalog of Michael Bolton's HICCUPPS-F oracle heuristic - the reference points a tester consults to decide 'is this a bug?': History, Image, Comparable products, Claims, Users' desires, Product (internal consistency), Purpose, Standards/statutes, plus Familiar problems. Use mid-session to test an observation against each oracle. For what to VARY use sfdpot-exploratory-heuristic, for touring an unfamiliar product use fcc-cuts-vids-heuristic, for quality criteria use crusspic-stmpl-heuristic.

manual-test-debrief

Session debrief template + tour-coverage tracker - captures the SBTM PROOF format (Past, Results, Obstacles, Outlook, Feelings) plus three-bucket time accounting (test design / setup / bug investigation), the tours applied + areas covered + areas skipped, and the per-session quality-of-attention signal. Output is the artifact a charter delivers into; the team aggregates debriefs across sessions to track what's been explored vs what's still uncharted. Use after every exploratory session - without the debrief, the session's findings disappear.

manual-test-script-author

Builds stakeholder-readable scripted manual test cases from a feature spec - emits either a step-table format (preconditions / steps / expected result / actual / pass-fail / notes) for spreadsheet review or a Gherkin Given/When/Then format for BDD-aware teams. Each script is self-contained (no implicit team knowledge), single-scenario (one happy + N edge per script), and includes the data setup the tester needs without being a developer. Use when a feature can't be (or shouldn't be) fully automated and a human tester needs an executable script - UAT, regression baselines, certification testing, exploratory follow-up scripts.

manual-testing-overview

Teaches human-driven testing end to end: when a predefined scripted test case is the right instrument versus a time-boxed exploratory session, how session-based test management works (charter with a stated mission, time box, session notes, debrief) with a worked charter and a filled-in session sheet, a decision rule for what to automate versus what to keep human, and what makes a manual bug report actionable (exact reproduction steps, observed versus expected, build and environment, evidence). Use when planning or running testing a person performs by hand, writing a charter for an exploratory session, deciding whether a check belongs in an automated suite or in a human session, or fixing bug reports that developers keep returning as not reproducible.

session-based-test-management-reference

Pure-reference catalog of Session-Based Test Management (SBTM) - the Bachs' framework for running exploratory testing as time-boxed sessions: the session (60-90 min), the charter (Explore X with Y to discover Z), the session-sheet structure, the TBS metrics, the cross-session dashboard, and the PROOF debrief. Use when authoring exploratory-testing charters, reviewing session sheets, or setting up time-boxed test sessions. Distinct from manual-test-debrief (the PROOF debrief template), exploratory-tours-reference (the session themes), and the heuristic catalog hiccupps-f-heuristic.

sfdpot-exploratory-heuristic

Pure-reference catalog of James Bach's SFDPOT heuristic - 'San Francisco Depot' - a 'you are here' framework that catalogues what a tester can vary in a system to find bugs. Six dimensions: Structure, Function, Data, Platform, Operations, Time. Use as a what-to-vary checklist during an exploratory session, complementing HICCUPPS-F (which catalogues what to compare against).

test-execution-checklist

Converts a regression suite (or test plan) into an executable manual checklist for cases when automation isn't viable - a release-day smoke checklist, a post-incident verification list, or a periodic compliance check. Outputs a per-TC checkbox list with the minimal preconditions, the action, and a one-line "what to look for" - short enough to fit on one page per major flow. Use when the team needs a focused human-runnable list (not full step-tables), e.g., for production smoke after deploy or for the on-call rotation's quick verification.

uat-script-author

Emits User Acceptance Testing scripts in stakeholder-readable format - pre-conditions / business-language steps / expected business outcome / pass-fail / sign-off. Tailored for non-developer testers (end users, SMEs, solution owners) per the UAT canonical definition. Output is one TC per stakeholder-meaningful scenario with explicit sign-off, suitable for compliance / contract / audit records. Use when a release requires formal UAT before sign-off - typical for B2B contracts, regulated industries, or any delivery where the customer's acceptance is the contractual gate.