property-based-testing

Generate diverse inputs and shrink counterexamples to verify software invariants.

9|3|Updated Jun 13, 2026
One-click install
npx skills add https://github.com/Sir-chawakorn/sanook-cli --skill property-based-testing-sir-chawakorn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: property-based-testing
Source: https://github.com/Sir-chawakorn/sanook-cli/tree/main/skills/property-based-testing
Command: npx skills add https://github.com/Sir-chawakorn/sanook-cli --skill property-based-testing-sir-chawakorn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the limitations of traditional example-based testing by automatically generating thousands of inputs to uncover edge cases, state-machine flaws, and logic errors that manual tests consistently miss.

Core Features & Use Cases

  • Universal Invariant Verification: Validates that your code maintains core properties (like round-trip consistency or idempotence) across vast input ranges.
  • Automated Counterexample Shrinking: Automatically reduces complex failure cases to the smallest possible input, making debugging immediate and precise.
  • Stateful Model Testing: Drives complex systems like caches or APIs through random command sequences to detect interaction bugs and race conditions.

Quick Start

Use the property-based-testing skill to generate a test suite for the current module that asserts the round-trip property for all inputs.

Frequently Asked Questions about property-based-testing

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

FAQPage Schema
How does property-based testing find edge cases that manual tests miss?

Property-based testing uncovers hidden bugs by generating thousands of randomized inputs to validate universal invariants, shrinking complex counterexamples down to the minimal reproducible case for precise debugging.

Can I use property-based testing to verify state machines and caches?

Yes, property-based testing supports stateful model testing by driving complex systems like caches and APIs through random command sequences to detect interaction bugs and race conditions.

What frameworks do I need to run automated invariant testing?

Automated invariant testing requires integration with property-based testing frameworks like Hypothesis, fast-check, or proptest to execute thousands of randomized test cases within a defined time budget.

What is counterexample shrinking in automated testing?

Counterexample shrinking is an automated process that reduces complex failure cases discovered during randomized testing to the smallest possible input, making debugging immediate and precise.

When should I choose property-based testing over example-based testing?

Choose property-based testing over example-based testing when validating codecs, parsers, state machines, and complex data structures where correctness is defined by universal rules like round-trip consistency rather than specific input-output pairs.