nw-pbt-stateful

Generate and verify operation sequences for stateful systems using model-based testing.

Updated Mar 18, 2024
One-click install
npx skills add https://github.com/v1bh0r/precise-ledger-pro --skill nw-pbt-stateful-v1bh0r
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nw-pbt-stateful
Source: https://github.com/v1bh0r/precise-ledger-pro/tree/main/nWave/skills/nw-pbt-stateful
Command: npx skills add https://github.com/v1bh0r/precise-ledger-pro --skill nw-pbt-stateful-v1bh0r

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Stateful property-based testing helps teams validate systems with mutable state by encoding expectations as models and generating operation sequences to exercise behavior.

Core Features & Use Cases

  • Model-based testing concepts for mutable state
  • Two-phase execution: generation and concrete execution against the real system
  • Command design patterns (precondition, execution, state transition, postcondition)
  • Anti-pattern awareness and best practices across databases, APIs, caches, queues, and file systems

Quick Start

Create a starter stateful PBT plan for a mutable key-value store to illustrate building a model, commands, and two-phase execution.

Frequently Asked Questions about nw-pbt-stateful

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

FAQPage Schema
What is stateful property-based testing and when do I need it for my system?

Stateful property-based testing validates systems with mutable state by encoding expectations as models and generating operation sequences. You need it for databases, APIs, caches, queues, state machines, and protocols to verify sequential behavior.

How do I test stateful APIs using model-based testing?

Model-based testing for stateful APIs uses a two-phase execution model. You define commands with explicit preconditions, state transitions, and postconditions to generate operation sequences, then execute them concretely against the real system to verify correctness.

Can I use property-based testing for databases and caches without external dependencies?

Yes, stateful property-based testing applies to databases, caches, queues, and file systems without external dependencies. It operates by generating symbolic references and verifying state transitions internally against your defined model.

What is the best way to structure commands for stateful property-based testing?

The best way to structure commands for stateful property-based testing is using the command design pattern. Define explicit preconditions, execution logic, state transitions, and postconditions to ensure correctness and create reusable test models.

How does two-phase execution work in stateful model-based testing?

Two-phase execution in stateful model-based testing separates test generation from concrete execution. The first phase generates operation sequences with symbolic references, and the second phase executes them against the real system to validate postconditions.

What are common anti-patterns to avoid when building stateful test models?

Common anti-patterns in stateful test models involve neglecting explicit preconditions, mishandling state transitions, and ignoring symbolic references. Following best practices ensures correct operation sequence generation and reusable models across databases and APIs.