nw-pbt-stateful
SolidStateful property-based testing patterns, model-based testing, and anti-patterns
AI & Automation 526 stars
55 forks Updated 1 weeks ago MIT
Install
Quality Score: 95/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# Stateful PBT
Stateful property-based testing for systems with mutable state. Language-agnostic concepts; load language skills for framework syntax.
## When to Use Stateful vs Stateless PBT
```
Is the system under test a pure function?
Yes -> Use stateless PBT (pbt-fundamentals skill)
No -> Does it have mutable state that affects behavior?
Yes -> Does the state change through a sequence of operations?
Yes -> Use stateful PBT (this skill)
No -> Use stateless PBT with setup/teardown
No -> Use stateless PBT
```
Use stateful PBT for: databases | APIs | caches | queues | state machines | protocols | connection pools | file systems.
## Core Concepts
### The Model
Simplified representation of system's expected state. Drives test generation and verification.
Rules for model design:
- Simpler than system under test (key-value store model is just a dict)
- Captures observable behavior, not implementation details
- Pure -- no side effects in model code
- Source of authority during both generation and shrinking
### Commands
Each command defines four things:
| Component | Purpose | When It Runs |
|-----------|---------|-------------|
| Precondition | Is this command valid in current state? | Generation + shrinking |
| Execution | Run operation on real system | Execution phase only |
| State transition | Update model | Both phases |
| Postcondition | Does real result match model? | Execution phase only |
### Two-Phase Execution
**Phase 1 -- Generatio...
Details
- Author
- nWave-ai
- Repository
- nWave-ai/nWave
- Created
- 3 months ago
- Last Updated
- 1 weeks ago
- Language
- Python
- License
- MIT
Similar Skills
Semantically similar based on skill content — not just same category
Testing & QA Solid
nw-pbt-fundamentals
Property-based testing core concepts, property taxonomy, and strategy selection (language-agnostic)
526 Updated 1 weeks ago
nWave-ai Testing & QA Solid
nw-property-based-testing
Property-based testing strategies, mutation testing, shrinking, and combined PBT+mutation workflow for test quality validation
526 Updated 1 weeks ago
nWave-ai Testing & QA Listed
property-based-testing
Use when writing tests for serialization, validation, normalization, or pure functions - provides property catalog, pattern detection, and library reference for property-based testing
43 Updated 3 months ago
diegosouzapw Testing & QA Listed
property-based-testing
Use when writing tests for serialization, validation, normalization, or pure functions - provides property catalog, pattern detection, and library reference for property-based testing
5 Updated 2 months ago
ed3dai