property-based-testing

Guide property-based testing of serialization, parsing, and smart contracts across languages.

1|Updated Mar 15, 2026
One-click install
npx skills add https://github.com/kennyolofsson23-netizen/claude-code-config --skill property-based-testing-kennyolofsson23-netizen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: property-based-testing
Source: https://github.com/kennyolofsson23-netizen/claude-code-config/tree/main/skills/property-based-testing
Command: npx skills add https://github.com/kennyolofsson23-netizen/claude-code-config --skill property-based-testing-kennyolofsson23-netizen

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Property-based testing guidance helps you find edge-case bugs and unclear specifications that example-based tests miss by turning executable properties into testable, repeatable specifications across languages and environments.

Core Features & Use Cases

  • Property catalog & priorities: A concise catalog of properties (roundtrip, idempotence, invariants, commutativity, associativity, identity, inverse, oracle) and priorities for common patterns like encode/decode, normalization, validators, sorting, and smart contracts.
  • End-to-end guidance: Decision trees for when to invoke PBT, step-by-step test generation patterns, input strategy design, library recommendations for Hypothesis/fast-check/proptest/Echidna, and refactoring patterns that make code testable.
  • Failure analysis & review: Concrete workflows for reproducing and classifying failures, checking property grounding, avoiding tautologies and vacuous tests, and improving shrinking and CI settings.
  • Use case: When you encounter serialization pairs, custom parsers, normalization/validation logic, pure algorithms, or smart-contract invariants, use these resources to design strong, maintainable PBT suites.

Quick Start

Propose a roundtrip and at least one invariant property for the encode/decode pair you want to test and suggest a Hypothesis or fast-check strategy for generating valid inputs.

Frequently Asked Questions about property-based-testing

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

FAQPage Schema
What is property-based testing and when should I use it over example-based tests?

Property-based testing finds edge-case bugs that example-based tests miss by turning executable properties into repeatable test specifications. Use it when testing serialization pairs, parsers, normalization logic, pure algorithms, or smart-contract invariants.

How do I write a property-based test for an encode and decode pair?

To write property-based tests for encode/decode pairs, propose a roundtrip property ensuring decode(encode(x)) equals x, and at least one invariant. Design input strategies using libraries like Hypothesis or fast-check to generate valid inputs for repeatable verification.

Does property-based testing work with smart contracts and which tools should I use?

Property-based testing works with smart contracts by fuzzing invariants and checking state transitions. Use specialized smart-contract fuzzing tools like Echidna, alongside general libraries like Hypothesis, fast-check, or proptest for multi-language test suite support.

What are the common property patterns I should check in my test suite?

Common property patterns to check include roundtrip, idempotence, invariants, commutativity, associativity, identity, and inverse properties. Prioritize these patterns for testing encode/decode pairs, normalization, validators, sorting, and smart-contract logic.

How do I analyze and reproduce failing property-based test results?

Analyze failing property-based tests by reproducing and classifying failures using concrete workflows. Check property grounding to avoid tautologies and vacuous tests, then improve shrinking and CI settings to minimize failing inputs and ensure repeatable verification.

Can I use property-based testing to refactor my code for better testability?

Yes, you can use property-based testing patterns to refactor code for testability. Apply decision trees for when to invoke property tests and use refactoring patterns that make serialization, parsing, and algorithmic logic easier to verify with generated inputs.