Skip to content
Back to skills

Property Based Testing

ASecurity

Use property-based testing to find edge cases: invariants, generators, shrinking and round-trip properties

  • 7 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
ai-agentstypescriptpythonrustgojavatestingapi

Works with

  • api

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add ansh44233/forge --skill property-based-testing --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Property Based Testing?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Property Based Testing
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ansh44233-property-based-testing/badge)](https://www.skillsdirectory.com/skills/ansh44233-property-based-testing)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Use property-based testing to find edge cases: invariants, generators, shrinking and round-trip properties
profile: full
tags: testing, quality
---

# Property-based testing

Use for parsers, serializers, algorithms, data transformations and anything with many edge cases.

## Find properties
- Round-trip: `decode(encode(x)) == x`.
- Invariants: sorting keeps length and elements, and the output is ordered.
- Oracles: compare against a simple, slow reference implementation.
- Idempotence: `normalize(normalize(x)) == normalize(x)`.
- Metamorphic relations: adding a filter never returns more results.

## Generators
Generate the input space the code really accepts, including empty values, unicode, extremes and duplicates. Build complex values from smaller generators, and constrain at generation time rather than discarding most cases.

## Tools
fast-check (TypeScript), Hypothesis (Python), proptest (Rust), jqwik (Java) and gopter or rapid (Go).

## Failures
Let the tool shrink failures to a minimal case, then add that case as a regular example test so it stays covered.

## Verify
Run with a fixed seed in CI and a higher number of runs locally or nightly. Record the seed on failure.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.