property-based-testing

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

Updated May 17, 2026
One-click install
npx skills add https://github.com/irrit-us/agent_misc --skill property-based-testing-irrit-us
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: property-based-testing
Source: https://github.com/irrit-us/agent_misc/tree/main/skills/property-based-testing
Command: npx skills add https://github.com/irrit-us/agent_misc --skill property-based-testing-irrit-us

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Example-based tests often miss edge cases in serialization, parsing, validation, and normalization code. This Skill detects code patterns where property-based testing provides stronger coverage and guides the generation, review, and design of property-based tests. ## Core Features & Use Cases - Automatic Pattern Detection: Recognizes encode/decode pairs, validators, normalizers, pure functions, and smart contract invariants that benefit from property-based testing. - Test Generation and Review: Creates property-based tests with appropriate strategies and edge cases, and reviews existing tests for tautologies, vacuous assumptions, and weak assertions. - Multi-Language Support: Covers Hypothesis (Python), fast-check (JavaScript/TypeScript), proptest (Rust), rapid (Go), jqwik (Java), and more, plus Echidna and Medusa for Solidity smart contracts. - Use Case: When writing tests for a JSON serializer, the Skill suggests a roundtrip property (decode(encode(x)) == x) with realistic input strategies and explicit edge-case examples instead of hand-picked examples. ## Quick Start Ask the assistant to write property-based tests for your serialization or validation function using the appropriate library for your language.

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 for serialization code?▼

Use a roundtrip property asserting that decode(encode(x)) equals the original input. In Python with Hypothesis, define a strategy for your message type with st.builds, then apply @given to generate inputs and assert the roundtrip holds.

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

Use Hypothesis for Python, fast-check for JavaScript/TypeScript, proptest for Rust, rapid for Go, and jqwik for Java. For Solidity smart contracts, use Echidna or Medusa fuzzers to test state invariants.

When should I not use property-based testing?▼

Avoid property-based testing for simple CRUD operations without transformation logic, UI code, integration tests with complex external setup, and code with side effects that cannot be isolated like network calls or database writes.

Why does my property-based test keep failing on edge cases?▼

First verify the property against docstrings, type hints, and documented preconditions. Failures may indicate a genuine bug, an over-constrained strategy generating invalid inputs, or an ambiguous specification that needs clarification before reporting.

How do I test Solidity smart contracts with property-based testing?▼

Use Echidna or Medusa fuzzers to test state invariants in EVM contracts. Write functions prefixed with echidna_ that return a boolean invariant, such as verifying balances remain non-negative, and the fuzzer generates transaction sequences to violate them.

What makes a property-based test low quality?▼

Critical issues include tautological assertions comparing an expression to itself and vacuous tests where contradictory assume() calls filter out all inputs. Also watch for tests that reimplement the function logic or only assert no exception occurs.