What it does
Builds a behavioral state-transition model (transition table + Mermaid stateDiagram-v2), picks and justifies a coverage criterion from risk, derives cases (including invalid-transition negatives) to meet it, keeps model->case traceability, and reports counts against the criterion.
When to use it
Complex stateful flows (order lifecycle, payment/3DS, session, subscription) where model coverage beats ad-hoc cases.
Prerequisites
qa.config.yml (paths.docs_dir, stack.api_spec_path, risk_areas drives the criterion); a stateful flow, or empty to default to the first risk_areas.critical area.
Output
ISO/IEC/IEEE 29119-3 Test Design Specification (model + derived Test Case Specification) -> docs/MBT-<feature>.md.
Mechanics
How it works
- Build the model: states, events, transitions, guards, actions, initial/final states
- Represent it as both a transition table and a Mermaid stateDiagram-v2
- Choose the coverage criterion (all-states / all-transitions / transition-pairs) and justify from risk
- Derive cases to meet it, including invalid-transition negative cases
- Maintain basis->model element->case->coverage item traceability; report counts vs the criterion achieved
Why it works
The theory behind it
Model-Based Testing (CT-MBT) applying the state-transition technique (CTFL v4.0 §4.2) via an explicit model, so coverage is a property of the model and completeness is provable. The maintainable model is the single source for regenerating tests (counters the pesticide paradox, Principle 5).
CT-MBT · CTFL v4.0 §4.2 (state transition)
Example
See it in use
> /qa:mbt "order lifecycle: cart → placed → paid → shipped → delivered"✓ Correct when It models the states/transitions and derives cases by a stated coverage criterion, reporting e.g. 14/14 transitions covered.
Related commands
Used by