property-based-testing

Provides guidance for implementing property-based tests across languages and smart contracts.

Updated Nov 23, 2025
One-click install
npx skills add https://github.com/manuelbrandner85/Weltenbibliothekapp --skill property-based-testing-manuelbrandner85
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: property-based-testing
Source: https://github.com/manuelbrandner85/Weltenbibliothekapp/tree/main/.agents/skills/property-based-testing
Command: npx skills add https://github.com/manuelbrandner85/Weltenbibliothekapp --skill property-based-testing-manuelbrandner85

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the limitations of example-based testing by automatically generating inputs to verify algebraic properties, ensuring your code handles edge cases and invariants that manual tests often miss.

Core Features & Use Cases

  • Property Detection: Automatically identifies opportunities for roundtrip, idempotence, and invariant testing in your codebase.
  • Test Generation: Provides structured guidance for writing robust property-based tests using industry-standard libraries like Hypothesis, fast-check, and proptest.
  • Design & Refactoring: Offers a workflow for Property-Driven Development and refactoring techniques to make complex logic more testable.

Quick Start

Ask the assistant to analyze your current function for serialization patterns and suggest a roundtrip property test to improve coverage.

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 do I need it for my code?

Property-based testing automatically generates inputs to verify algebraic properties and state invariants, replacing manual example-based tests. You need it to ensure your code handles edge cases and complex logic that manual unit tests often miss.

How do I write property-based tests for serialization roundtrips?

To write property-based tests for serialization roundtrips, you define a property stating that deserializing a serialized object yields the original object. This Skill guides you through identifying such patterns and structuring tests using libraries like Hypothesis, fast-check, or proptest.

Does property-based testing work with smart contract environments?

Yes, property-based testing works with smart contract environments. This Skill provides comprehensive guidance for implementing property-based logic to verify state invariants and detect edge cases specifically within smart contract codebases.

What's the best way to refactor complex logic to make it testable with property-based testing?

The best way to refactor complex logic for property-based testing is using Property-Driven Development. This Skill offers a workflow to identify testable patterns like idempotence and validators, helping you restructure code to satisfy high-coverage verification requirements.

Can I use property-based testing to augment my existing example-based unit tests?

Yes, you can augment existing example-based unit tests with property-based testing. This approach allows you to automatically generate diverse inputs to verify algebraic specifications, ensuring robust edge-case handling alongside your manual tests.

Why does my unit test coverage miss edge cases that property-based testing catches?

Unit test coverage misses edge cases because example-based testing relies on manually specified inputs. Property-based testing automatically generates a wide range of inputs to detect testable patterns like serialization pairs and state invariants, exposing hidden edge cases.