oracle-model-based

Generates stateful model-based tests that compare implementations against abstract state machine models.

Updated Jun 24, 2026
One-click install
npx skills add https://github.com/Hakkadaikon/hymme --skill oracle-model-based-hakkadaikon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: oracle-model-based
Source: https://github.com/Hakkadaikon/hymme/tree/main/skills/oracle-model-based
Command: npx skills add https://github.com/Hakkadaikon/hymme --skill oracle-model-based-hakkadaikon

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires fast-check, vitest.

What problem does it solve? When expected values cannot be written by hand for every case, this Skill provides a way to test stateful systems by defining an abstract model (such as a state machine) as the test oracle, auto-generating operation sequences, and checking the real implementation against the model step by step. ## Core Features & Use Cases - Abstract Model Definition: Represent system behavior with a deliberately naive model (e.g., an LRU cache as an insertion-ordered Map) that serves as a trustworthy oracle. - Stateful Property-Based Testing: Use fast-check commands with check/run contracts to generate operation sequences and run model and implementation in parallel, verifying return values and invariants after every step. - State and Transition Coverage: Confirm generated sequences reach all model states and transitions, using fc.statistics or TLA+/TLC transition sets as a coverage ledger. - Use Case: Testing an LRU cache where you generate random put/get sequences, advance both a naive Map-based model and the real cache, and catch divergence on any step. ## Quick Start Ask the AI to write a model-based test for your stateful component using fast-check commands, with a naive abstract model as the oracle and per-step state comparison.

Frequently Asked Questions about oracle-model-based

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

FAQPage Schema
How do I write model-based tests with fast-check?

Define each operation as a fast-check Command with a check method for preconditions and a run method that advances both the model and the real implementation. Then use fc.commands to generate operation sequences and fc.modelRun to execute them step by step.

What is model-based testing and when should I use it?

Model-based testing represents system behavior as an abstract model like a state machine, generates operation sequences from it, and compares the real system against the model. Use it for stateful targets such as protocols, APIs, and data structures where history affects behavior.

When is model-based testing not appropriate?

It is excessive for pure functions with no state or ordering, where ordinary property-based testing is sufficient. It also breaks down if the model grows as complex as the implementation, since the model itself becomes a source of bugs.

Why does my model-based test oracle give unreliable results?

The model is likely too complex. The model must stay deliberately naive compared to the implementation, because bugs in the model corrupt the oracle and make both passing and failing results untrustworthy.

How do I verify state and transition coverage in stateful property-based tests?

Increase the size parameter of fc.commands, adjust operation generation probabilities, and use fc.statistics to inspect the distribution of generated sequences. If the state machine is specified in TLA+, compare against the states and transitions TLC explored.