Static testing, analysis & design

/qa:mbt

Model-Based Testing

Model a stateful flow as a state machine and derive cases to a stated coverage criterion (all-states / all-transitions / 0-switch) — provable completeness instead of ad-hoc cases.

USAGE/qa:mbt <feature / stateful flow>
Static testing, analysis & designCT-MBT · CTFL v4.0 §4.2 (state transition)Manual

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

  1. Build the model: states, events, transitions, guards, actions, initial/final states
  2. Represent it as both a transition table and a Mermaid stateDiagram-v2
  3. Choose the coverage criterion (all-states / all-transitions / transition-pairs) and justify from risk
  4. Derive cases to meet it, including invalid-transition negative cases
  5. 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

mbt
> /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.