Skip to content
aj-geddes avatar

Property Based Testing

Property-based testing skill that checks code invariants against automatically generated inputs across Python, JavaScript, and Java.

CCM score
40 of 100
skills.sh installs
458
GitHub stars
396
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers when to use property tests, including algorithms, invariants, parsers, round-trip encoding, and sorting or data structure operations
  • Includes a Python Hypothesis quick start with round-trip, length, and first-to-last properties, plus reference guides for fast-check and junit-quickcheck
  • Guides users toward shrinking failures to minimal cases, combining properties with known example tests, and avoiding tautologies
  • Designed for developers who want to surface edge cases that example-based tests tend to miss

Install

$ npx -y skills add aj-geddes/useful-ai-prompts --skill property-based-testing -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Property-Based Testing

Table of Contents

Overview

Property-based testing verifies that code satisfies general properties or invariants for a wide range of automatically generated inputs, rather than testing specific examples. This approach finds edge cases and bugs that example-based tests often miss.

When to Use

  • Testing algorithms with mathematical properties
  • Verifying invariants that should always hold
  • Finding edge cases automatically
  • Testing parsers and serializers (round-trip properties)
  • Validating data transformations
  • Testing sorting, searching, and data structure operations
  • Discovering unexpected input combinations

Quick Start

Minimal working example:

# test_string_operations.py
import pytest
from hypothesis import given, strategies as st, assume, example

def reverse_string(s: str) -> str:
    """Reverse a string."""
    return s[::-1]

Details

Repository
github.com/aj-geddes/useful-ai-prompts
Category
Testing & QA
First seen
Jun 3, 2026

Questions

What does the property-based-testing skill do?

It designs property-based tests that check code properties hold for all inputs using automatic test case generation. It is aimed at algorithms, invariants, parsers, serializers and data transformations rather than specific examples.

How do I install the property-based-testing skill?

Run npx -y skills add aj-geddes/useful-ai-prompts --skill property-based-testing -y in your project. Once installed, the agent can write property-based tests with Hypothesis, fast-check or junit-quickcheck.

Which languages and libraries does property-based-testing support?

The skill includes reference guides for Hypothesis in Python, fast-check in JavaScript and TypeScript, and junit-quickcheck in Java. Each guide covers how to write generative tests in that language.

Where does property-based-testing sit in the Testing and QA category?

It is listed in the Testing and QA category alongside tdd, webapp-testing and break-ui. It differs from those by focusing on general properties and automatically generated inputs instead of hand-written examples.

More from aj-geddes/useful-ai-prompts

All 258

Similar to Property Based Testing

More Testing & QA