designing-property-based-tests

Design invariant-based property tests for encoders, parsers, normalizers, and validators.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/somachak/claude-code-skills-db --skill designing-property-based-tests
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: designing-property-based-tests
Source: https://github.com/somachak/claude-code-skills-db/tree/main/skills/testing/designing-property-based-tests
Command: npx skills add https://github.com/somachak/claude-code-skills-db --skill designing-property-based-tests

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Property-based testing identifies invariants and generates diverse inputs to reveal edge cases that example-based tests often miss, improving test coverage for encoders, parsers, normalizers, and validators across TypeScript/Node and Python projects.

Core Features & Use Cases

  • Clear guidelines on when to use property-based testing and how to design effective generators
  • Worked examples for fast-check (TypeScript/Node) and Hypothesis (Python)
  • Best practices for shrinking, model-based testing, and safe test design to avoid flaky tests

Quick Start

Run a property-based test suite against your encoder/decoder, parser, or normalizer to validate invariants.

Frequently Asked Questions about designing-property-based-tests

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

FAQPage Schema
How does property-based testing improve coverage for parsers and validators?

Property-based testing improves coverage for parsers and validators by generating diverse inputs to identify invariants and edge cases that example-based tests often miss.

How do I design effective test generators using fast-check and Hypothesis?

Design effective fast-check and Hypothesis test generators by following structured guidelines to produce diverse inputs, ensuring invariant-based tests validate encoders and normalizers without triggering flaky behavior.

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

Use property-based tests instead of example-based tests when validating encoders, parsers, normalizers, and validators to reveal edge cases, applying a decision framework to determine exact invocation scenarios.

Does property-based testing work with both TypeScript and Python projects?

Property-based testing works with both TypeScript and Python projects, providing concrete guidance and worked examples using fast-check for Node environments and Hypothesis for Python.

What are common anti-patterns to avoid when shrinking test inputs?

Common anti-patterns to avoid when shrinking test inputs include unsafe test designs that cause flaky tests, which best practices for shrinking and model-based testing help prevent.

Can I apply model-based testing to normalizers across Node and Python?

Apply model-based testing to normalizers across Node and Python using fast-check and Hypothesis, following provided best practices to structure invariant-based tests and avoid flaky behavior.