本文へ移動
cccskills
無料GitHub で公開

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.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qaスター 13(GitHub 13 + cccskills 0)

実行スコア 未検証

インストール方法を見る

含まれるファイル(22)

  • SKILL.md14.8 KB
  • .tessl-plugin/plugin.json995 B
  • evals/contract-countersign-routing/criteria.json4.5 KB
  • evals/contract-countersign-routing/task.md3.9 KB
  • evals/exam-attempt-coverage-claim/criteria.json4.2 KB
  • evals/exam-attempt-coverage-claim/task.md3.7 KB
  • evals/gift-card-redemption-rules/criteria.json4.4 KB
  • evals/gift-card-redemption-rules/task.md3.8 KB
  • evals/loan-underwriting-visible-states/criteria.json4.1 KB
  • evals/loan-underwriting-visible-states/task.md5.2 KB
  • evals/onboarding-wizard-post-submit/criteria.json4.1 KB
  • evals/onboarding-wizard-post-submit/task.md4.0 KB
  • evals/parcel-scan-out-of-order/criteria.json3.6 KB
  • evals/parcel-scan-out-of-order/task.md3.6 KB
  • evals/pipeline-cancel-race/criteria.json4.2 KB
  • evals/pipeline-cancel-race/task.md3.9 KB
  • evals/scale-pairing-rejections/criteria.json4.0 KB
  • evals/scale-pairing-rejections/task.md4.1 KB
  • evals/subscription-dunning-lifecycle/criteria.json4.0 KB
  • evals/subscription-dunning-lifecycle/task.md4.4 KB
  • evals/ticket-reopen-sequences/criteria.json4.4 KB
  • evals/ticket-reopen-sequences/task.md3.8 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

state-transition-test-design

Overview

Per ISTQB CTFL Syllabus v4.0.1 §4.2.4, "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 (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). 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).

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).

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):

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).

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). 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). 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). 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 (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 (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.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

Builds a CI gate that fails the build on **new** WCAG / a11y violations introduced by a PR while grandfathering pre-existing violations on a per-rule / per-page baseline. Aggregates verdicts from axe-core / pa11y / Lighthouse a11y / WAVE / IBM Equal Access scans. Use when a project has accumulated a11y debt and a strict "zero violations" gate would block every PR - the ratchet pattern lets the team ship while preventing regressions.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qa132026年10月20日 更新

Workflow skill that builds an A/B-test validity checklist from an experiment proposal, walking the canonical design-correctness gates - pre-registered OEC/power/guardrails, randomization unit + SRM check, assignment integrity, telemetry, peeking discipline, novelty/primacy, post-experiment SRM re-check - into a per-experiment checklist + sign-off form. Use when launching, auditing, or governing an experiment. For pitfall mechanics (guardrails, peeking) see experiment-results-interpreter's references; to read an already-valid result use experiment-results-interpreter; for per-SDK harness tests use experiment-sdk-testing - this gates DESIGN, not SDK code.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qa132026年10月20日 更新

The single install-flow skill: the reference contract for the PWA install flow (installability gate fields, `beforeinstallprompt` handshake, per-platform paths - Android WebAPK / iOS Share menu / Firefox no-op - and the `display-mode` post-install signal, in references/install-flow-reference.md) plus the build-an-X workflow that emits the Add-to-Home-Screen suite. Walks the four-stage timeline, emitting one test per gate cell per [web.dev/articles/install-criteria][install-criteria], the deferred-prompt → `prompt()` → `userChoice` chain per [web.dev/articles/customize-install][customize-install], the iOS Safari manual-metadata branch (`apple-touch-icon`) per [web.dev/learn/pwa/installation][learn-pwa], and the post-install `(display-mode: standalone)` MQ assertion. Output: a Playwright spec with per-stage cells plus a coverage matrix. Use when a PWA's manifest, icons, or install handler change, when install conversion drops at an unknown stage, or when triaging a flaky install assertion.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qa132026年10月20日 更新

Build-an-X workflow that uses an LLM to map existing tests to spec sections - given a spec doc + the test suite, the LLM identifies which tests cover which sections, surfaces uncovered sections (gap), and recommends specific tests to add. Output is a coverage matrix per spec ID. Scope is mapping tests that already exist and naming the gaps, not authoring tests for new acceptance criteria. Use when a spec doc and a test suite both exist but nobody can say which requirements are actually covered - before a release sign-off, an audit, or a decision about where to spend the next round of test effort.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qa132026年10月20日 更新

Generates tests from natural-language specs (acceptance criteria, user stories, requirements) using an LLM, with confidence scoring per test case (LLM self-assessment plus heuristics: assertion quality, naming, completeness), batching uncertain cases for human review, and integration with the team's existing test framework. Use when the user asks to generate unit tests from acceptance criteria, convert user stories to test cases, automate test creation from requirements, or augment a spec-driven test suite with AI-generated stubs that are then curated before merge.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qa132026年10月20日 更新

Configures Allure Report (test-runner adapter install, `allure-results` directory wiring, `categories.json` for failure classification, `history-trend.json` retention via the copy-history-between-runs pattern), runs the Allure CLI to convert `allure-results` to a static HTML site, and uploads the report as a CI artifact. Use when the team needs richer test reporting than JUnit XML - step-level attachments, per-test history, retry tracking, and severity / epic / feature labeling across framework-agnostic adapters (pytest, Jest, JUnit, TestNG, NUnit, Mocha). As a rich static HTML report generator, it is the open-source alternative to the sunset ExtentReports (JVM/.NET per-test HTML narrative); for hosted cross-run flakiness analytics rather than a static per-run report use currents-integration.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qa132026年10月20日 更新

testland のスキルをすべて見る

このスキルの問題を報告する