property-based-testing
Property-based testing (PBT) patterns with fast-check (JS/TS), Hypothesis (Python), and gopter (Go). Generate random inputs, define invariants, shrink failures to minimal cases. Adapted from Trail of Bits. Use when testing pure functions, parsers, serializers, state machines, or any code where example-based tests miss edge cases.
Profile →npx skills add vibeeval/vibecosystem --skill property-based-testing --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Property-Based Testing Instead of testing specific examples, define properties that must hold for ALL inputs. The framework generates hundreds of random inputs and finds the smallest failing case. ## When to Use PBT | Use Case | Property | |----------|----------| | Serialization roundtrip | `deserialize(serialize(x)) === x` | | Sort function | Output is ordered AND contains same elements | | Parser | Never crashes on any input | | Encoder/decoder | `decode(encode(x)) === x` | | State machine | Invariants hold after any sequence of operations | | Math/financial | Associativity, commutativity, identity, bounds | | API handler | Never returns 500 on valid input | | Data transformation | Output schema matches specification | ## When NOT to Use PBT - UI rendering tests (use visual regression) - Integration tests with external services (use contract tests) - Tests that need specific business scenarios (use example tests) - Tests where the oracle is as complex as the implementation ## fast-check (JavaScript/TypeScript) ### Setup ```bash npm install --save-dev fast-check ``` ### Basic Property ```typescript import fc from 'fast-check' // Property: sorting is idempotent test('sort is idem
- When to Use PBT
- When NOT to Use PBT
- fast-check (JavaScript/TypeScript)
- Setup
- Basic Property
- Custom Arbitraries
- Stateful Testing (Model-Based)
- Hypothesis (Python)
- Basic Properties
- Custom Strategies
- gopter (Go)
- Property Catalog
- Algebraic Properties
- Safety Properties
npm install --save-dev fast-check pip install hypothesis go get github.com/leanovate/gopter
What does the property-based-testing skill do?
Property-based testing (PBT) patterns with fast-check (JS/TS), Hypothesis (Python), and gopter (Go). Generate random inputs, define invariants, shrink failures to minimal cases. Adapted from Trail of Bits. Use when testing pure functions, parsers, serializers, state machines, or any code where example-based tests miss edge cases.
How do I install it?
Run `npx skills add vibeeval/vibecosystem --skill property-based-testing --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From vibeeval/vibecosystem, a repository with 521 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.