property-based-testing

Generates and reviews property-based tests across multiple languages and smart contracts.

Updated Apr 3, 2026
One-click install
npx skills add https://github.com/Ayoub-ouederni/SENTINEL --skill property-based-testing-ayoub-ouederni
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: property-based-testing
Source: https://github.com/Ayoub-ouederni/SENTINEL/tree/main/.claude/skills/property-based-testing
Command: npx skills add https://github.com/Ayoub-ouederni/SENTINEL --skill property-based-testing-ayoub-ouederni

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Example-based tests only cover the cases developers think to write, leaving edge cases in serialization, parsing, validation, and smart contract logic undiscovered until production failures occur. ## Core Features & Use Cases - Automatic PBT Detection: Recognizes patterns like encode/decode pairs, validators, normalizers, and pure functions where property-based testing provides stronger coverage than example tests. - Test Generation and Review: Creates property-based tests with appropriate strategies and edge cases, and audits existing tests for tautologies, vacuous assumptions, and weak assertions. - Smart Contract Invariants: Supports Echidna and Medusa fuzzing for Solidity/EVM contracts with state invariant testing. - Use Case: When writing tests for a JSON serializer, the skill detects the encode/decode pair and generates a roundtrip property test using Hypothesis or fast-check with realistic input strategies and explicit edge cases. ## Quick Start Ask Claude to write property-based tests for your serialization or validation function and it will detect the pattern and generate appropriate property tests.

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 in Python?

Use the Hypothesis library with the @given decorator and strategies from hypothesis.strategies to generate inputs. Define properties like roundtrip (decode(encode(x)) == x) or idempotence (f(f(x)) == f(x)) rather than specific example values.

What is the difference between Hypothesis and fast-check?

Hypothesis is the property-based testing library for Python, while fast-check serves JavaScript and TypeScript. Both provide input generators and automatic shrinking of failing cases, with equivalent concepts like strategies and arbitraries.

Can property-based testing be used for Solidity smart contracts?

Yes, Echidna and Medusa are property-based fuzzers for EVM contracts that test state invariants. You define functions like echidna_balance_invariant that must always return true, and the fuzzer attempts to violate them.

When should I not use property-based testing?

Avoid PBT for simple CRUD operations without transformation logic, UI code, integration tests with complex external setup, and one-off scripts. It works best for unit-level pure functions, serializers, validators, and normalizers.

Why does my property-based test always pass vacuously?

Vacuous tests usually result from contradictory or overly restrictive assume() calls that filter out nearly all generated inputs. Fix this by building constraints directly into the input strategy instead of filtering after generation.

How do I interpret a failing property-based test?

First reproduce the shrunk minimal failing example, then verify the property against docstrings, type hints, and documented preconditions. Classify the failure as a test bug, ambiguous specification, or genuine bug before reporting it.