property-based-testing

Writes, reviews, and debugs property-based tests across Hypothesis, fast-check, proptest, and Echidna.

1|Updated Jan 4, 2026
One-click install
npx skills add https://github.com/stefaniuk/loadout --skill property-based-testing-stefaniuk
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: property-based-testing
Source: https://github.com/stefaniuk/loadout/tree/main/.github/skills/property-based-testing
Command: npx skills add https://github.com/stefaniuk/loadout --skill property-based-testing-stefaniuk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Example-based tests only check hand-picked inputs, leaving most of the input domain untested and letting edge-case bugs slip through. This Skill helps you assert rules over entire input domains so generators hunt for counterexamples, and it helps you tell a real bug from a wrong property when a test fails. ## Core Features & Use Cases - Property identification and test writing: Apply a catalog of properties (roundtrip, inverse, oracle, idempotence, invariants) with strategy design, edge-case pinning, and correct settings for Hypothesis, fast-check, proptest, jqwik, rapid, and more. - Test review and failure triage: Detect tautological, vacuous, and reimplementing tests, then classify shrunk counterexamples as code bugs, wrong properties, or ambiguous specs. - Smart contract invariants: Write Echidna and Medusa property-mode and assertion-mode tests for Solidity, covering solvency, supply conservation, and access control. - Use Case: Given a URL canonicalizer, generate a Hypothesis suite that discovers a percent-encoding defect where a second pass re-encodes its own escapes, then verify the suite fails on the defective code and passes on the patched version. ## Quick Start Ask the assistant to write property-based tests for your serializer, parser, or validator, or to review an existing Hypothesis or fast-check suite for weak assertions.

Frequently Asked Questions about property-based-testing

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

FAQPage Schema
How do I write property-based tests with Hypothesis in Python?▼

Use @given with strategies that generate valid inputs directly, such as st.integers(min_value=1), instead of filtering with assume(). Pin known edge cases with @example, and set max_examples and deadline=None in settings for CI and nightly runs.

What is the difference between Echidna property mode and assertion mode?▼

Property mode uses a view function returning bool that Echidna checks after every transaction sequence, suited for global state invariants. Assertion mode places an assert inside a callable function, suited for properties about a specific operation like a deposit.

Which property-based testing library should I use for my language?▼

Match the project's existing choice: Hypothesis for Python, fast-check for TypeScript, proptest for Rust, rapid for Go, jqwik for Java, and Echidna or Medusa for Solidity. Introducing a second PBT library into a codebase that already has one is not worth it.

Why does my Hypothesis test pass but assert nothing?▼

The test is likely tautological, reimplementing the function's own logic, or vacuous because assume() filters out nearly every input. Push constraints into the strategy and assert a property that constrains the function without recomputing it.

How do I tell if a shrunk counterexample is a real bug?▼

Ground the property against the documented contract in order of authority: external spec, type annotations, docstrings, existing tests, then the function name. A failure violating a documented guarantee is a code bug; one violating a documented precondition means the strategy is over-broad.

When is property-based testing not worth using?▼

Skip it when the code has no algebraic shape such as an inverse, invariant, or oracle, and the strongest available property is only no-crash. It is also not for coverage-guided binary fuzzing, mutation testing, static analysis, or end-to-end UI tests.