model-based-testing

Designs state machine models and derives test cases with node, edge, and path coverage metrics.

Updated Aug 31, 2026
One-click install
npx skills add https://github.com/ahuaracab/test-genesis --skill model-based-testing-ahuaracab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: model-based-testing
Source: https://github.com/ahuaracab/test-genesis/tree/main/.agents/skills/model-based-testing
Command: npx skills add https://github.com/ahuaracab/test-genesis --skill model-based-testing-ahuaracab

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Testing stateful systems like payment flows, authentication, and order workflows often misses transitions, guard conditions, and error paths because test cases are written ad hoc. This Skill builds a formal state machine model from acceptance criteria first, then derives test cases systematically so coverage is measurable and auditable. ## Core Features & Use Cases - State Machine Modeling: Build ASCII or UML state diagrams with explicit states, transitions, guards, and actions before writing any test case. - Coverage-Driven Test Generation: Derive test cases targeting node coverage (95%), edge coverage (85%), and risk-driven path coverage, including guard-true, guard-false, and error-recovery paths. - State Explosion Mitigation: Apply aggregation, transient-state elimination, orthogonal FSM separation, and hierarchical decomposition to keep complex models testable. - Use Case: Given an acceptance criterion like "user logs in with email, password, and OTP", produce a full authentication FSM with 18 derived test cases covering lockout, OTP expiry, retries, and notification side-effects. ## Quick Start Ask the AI to design a state machine model and derive coverage-based test cases for your payment or authentication workflow acceptance criteria.

Frequently Asked Questions about model-based-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design test cases from a state machine model?

Build the state diagram first with all states, transitions, guards, and actions, then derive test cases per transition: happy path (guard true), blocked path (guard false), and action side-effect verification. Target 95% node coverage and 85% edge coverage.

What is the difference between node, edge, and path coverage in model-based testing?

Node coverage requires visiting every state at least once. Edge coverage requires executing every transition, including guard-true and guard-false paths. Path coverage exercises selected critical sequences like happy paths and error recovery, and is optional and risk-driven.

When should I use state-transition testing instead of equivalence partitioning?

Use state-transition testing when behavior depends on prior events, such as workflows, multi-step processes, or state-dependent validation. Equivalence partitioning classifies inputs but ignores state history, so it cannot express transition logic.

How do I handle state explosion in complex FSM models?

Apply four strategies: aggregate similar states, eliminate transient microsecond states, separate orthogonal dimensions into independent FSMs tested individually, and use hierarchical submachines. Avoid testing the full Cartesian product of combined states.

Can model-based testing handle non-deterministic or timed transitions?

Non-deterministic transitions should be split into deterministic ones with explicit guard conditions. Timed transitions like OTP expiry are tested with mock time or time-travel libraries rather than real waits, verifying the timer fires correctly on expiration.