property-based-testing

Generate and review property-based tests across multiple languages and smart contracts.

Updated Apr 5, 2026
One-click install
npx skills add https://github.com/marumo333/atrox --skill property-based-testing-marumo333
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: property-based-testing
Source: https://github.com/marumo333/atrox/tree/main/.claude/skills/trailofbits/plugins/property-based-testing/skills/property-based-testing
Command: npx skills add https://github.com/marumo333/atrox --skill property-based-testing-marumo333

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 writing, reviewing, and debugging those tests. ## Core Features & Use Cases - Pattern Detection: Recognizes encode/decode pairs, validators, normalizers, pure functions, and smart contract invariants that benefit from property-based testing. - Test Generation & Review: Produces tests with proper strategies, properties, and edge cases, and audits existing tests for tautologies, vacuous assumptions, and weak assertions. - Failure Interpretation: Classifies failing examples as genuine bugs, test bugs, or ambiguous specifications before reporting. - Use Case: When writing tests for a JSON serializer, the Skill suggests a roundtrip property (decode(encode(x)) == x) with Hypothesis, fast-check, proptest, or Echidna depending on the language. ## Quick Start Ask the AI 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 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)), and add @example decorators for edge cases like empty lists and zero values.

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, jqwik for Java, and ScalaCheck for Scala. For Solidity smart contracts, use Echidna or Medusa fuzzers to test state invariants.

When should I use property-based testing instead of example-based tests?▼

Use property-based testing for serialization pairs, parsers, normalizers, validators, and pure functions with complex input domains. Avoid it for simple CRUD operations, UI logic, integration tests with external dependencies, or throwaway prototype code.

Why does my property-based test failure not indicate a real bug?▼

Failures can stem from wrong properties, strategies generating inputs outside the documented domain, or ambiguous specifications. Verify the property against docstrings and type annotations, check strategy realism, and confirm the input violates a documented guarantee before reporting a bug.

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

Use Echidna or Medusa, which are property-based fuzzers for EVM contracts. Write invariant functions prefixed with echidna_ that return a boolean, such as checking that contract balance stays non-negative, and the fuzzer generates transaction sequences to violate them.

What makes a property-based test low quality?▼

Critical issues include tautological assertions that compare an expression to itself and vacuous tests where contradictory assume() calls filter out all inputs. High-severity issues include tests with no assertions or assertions that reimplement the function's own logic.