property-based-testing
Skill1 starsChanged 53 days agoMITView on GitHub
Use when example-based tests miss edge cases — property-based testing with Hypothesis, fast-check, jqwik, QuickCheck, or proptest; invariants, round-trip, oracle and metamorphic properties, shrinking, stateful/model-based tests.
18 other projects use a version of this.
Adopted by
Most recently taken up by
- selamy-labs/agent-skillstheir own version, first seen Nov 8, 2026
- lecluse-net/galaristheir own version, first seen Oct 30, 2026
- davidanthonyn/claude-skillstheir own version, first seen Oct 20, 2026
- allanninal/claude-code-skillstheir own version, first seen Oct 17, 2026
- alialavia/pbt-skillstheir own version, first seen Oct 16, 2026
- mike22890/opencode-skills-entheir own version, first seen Oct 15, 2026
Used with
Projects with it also use observability, simplify and 3 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
OpenAISkillobservability
Vercel Observability expert guidance — Drains (logs, traces, speed insights, web analytics), Web Analytics, Speed Insights, runtime logs, custom events, OpenTelemetry integration, and monitoring dashboards. Use when instrumenting, debugging, or optimizing application performance and user experience on Vercel.
Also in 3 projects that use this
Hugging FaceSkillsimplify
Refactor code after tests pass. The "Refactor" phase of Red-Green-Refactor.
Also in 3 projects that use this
Microsoft AzureSkillgit-workflow
Squad branching model: dev-first workflow with insiders preview channel
Also in 3 projects that use this
SentrySkillsecurity-review
Finds exploitable application security vulnerabilities in code changes. Use for Warden security scans, appsec review, OWASP-style checks, authentication or authorization bugs, injection, XSS, SSRF, path traversal, secrets, unsafe crypto, webhook verification, open redirects, or sensitive data exposure.
Also in 3 projects that use this
NVIDIASkillresearch
Before designing a feature, research how comparable libraries solve the problem, check best practices, known pitfalls, and upstream changes. Use when starting a new feature, investigating an unfamiliar area, or the user asks to research something.
Also in 3 projects that use this
Other versions18 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 18
- an8079/take-skills★ 4same name
- igmarin/elixir-phoenix-skills★ 4same name
- kimtth/agent-skill-100-lines-or-less★ 2same name
- rmusser01/tldw-stuff★ 2same name
- alialavia/pbt-skills★ 1same name
- allanninal/claude-code-skills★ 1same name
- lecluse-net/galaris★ 1same name
- mike22890/opencode-skills-cn★ 1same name
- mike22890/opencode-skills-en★ 1same name
- mmondora/claude-skills★ 1same name
8 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository98 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- 42crunch-api-security-testingSkill
- a-b-testingSkill
- acceptance-testingSkill
- accessibility-testingSkill
- ai-agent-evaluationSkill
- ai-code-securitySkill
- ai-ml-testingSkill
- analytics-tracking-testingSkill
- api-testingSkill
- authn-authz-testingSkill
- autonomous-qa-orchestrationSkill
- bdd-gherkin-testingSkill
- blockchain-smart-contract-testingSkill
- bug-reportingSkill
- chaos-resilience-testingSkill
- chatbot-voice-agent-testingSkill
- cicd-testingSkill
- cli-testingSkill
- cloud-infrastructure-testingSkill
- code-coverage-analysisSkill
- compatibility-testingSkill
- compliance-testingSkill
- concurrency-race-condition-testingSkill
- configuration-feature-flag-testingSkill
- contract-testingSkill
- cross-browser-testingSkill
- database-testingSkill
- data-migration-testingSkill
- data-pipeline-etl-testingSkill
- date-time-timezone-testingSkill
- desktop-app-testingSkill
- disaster-recovery-backup-testingSkill
- e2e-testingSkill
- email-notification-testingSkill
- event-driven-messaging-testingSkill
- exploratory-testingSkill
- flaky-test-managementSkill
- functional-testingSkill
- fuzz-testingSkill
- game-testingSkill
- graphql-testingSkill
- iac-container-security-testingSkill
- installation-upgrade-testingSkill
- integration-testingSkill
- iot-embedded-testingSkill
- llm-security-auditSkill
- llm-testingSkill
- localization-testingSkill
- manual-testingSkill
- mcp-testingSkill
- memory-leak-resource-testingSkill
- microservices-testingSkill
- mobile-testingSkill
- mutation-testingSkill
- observability-testingSkill
- payment-ecommerce-testingSkill
- performance-testingSkill
- production-monitoring-synthetic-testingSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 17 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Instead of asserting f(3) == 9, assert a property that must hold for all inputs.
- Very specific: line 50
Keep generators fast; set max_examples (default 100) up in CI nightly (1000+), down for PR (50).
“Common” is measured: kept by at least 6 in 10 of the 17 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Property-Based Testing (PBT)
Instead of asserting f(3) == 9, assert a property that must hold for all inputs; the framework generates hundreds of cases, then shrinks any failure to a minimal counter-example.
Find properties (the hard part) — 7 patterns
- Round-trip:
decode(encode(x)) == x(serializers, parsers, compress, crypto). - Invariant:
len(sort(xs)) == len(xs), output is ordered, total money conserved. - Idempotence:
f(f(x)) == f(x)(normalize, dedupe, PUT). - Oracle: compare with a slow/simple reference implementation.
- Metamorphic:
search(q + filter) ⊆ search(q);price(2×qty) == 2×price(qty). - Commutativity/associativity where the domain promises it.
- No-crash / postcondition: for any valid input, no exception and result satisfies the contract.
Examples
# Python — Hypothesis
from hypothesis import given, strategies as st, settings
@given(st.lists(st.integers()))
def test_sort_props(xs):
out = sorted(xs)
assert len(out) == len(xs)
assert all(a <= b for a, b in zip(out, out[1:]))
assert sorted(out) == out # idempotent// TypeScript — fast-check
import fc from "fast-check";
test("json round-trip", () => {
fc.assert(fc.property(fc.jsonValue(), v => expect(JSON.parse(JSON.stringify(v))).toEqual(v)));
});pytest --hypothesis-seed=12345 # reproduce a failing run
npx jest --testTimeout=30000 # PBT can be slowerGenerator design
- Constrain to the valid domain with strategies (
st.integers(0, 120)), notassume()filters that discard most inputs. - Build domain objects with composite strategies (
@st.composite,fc.record). Include nasty values: empty, huge, unicode, NaN, negative zero, duplicates. - Keep generators fast; set
max_examples(default 100) up in CI nightly (1000+), down for PR (50).
Stateful / model-based testing
Model the system as a simple state machine; generate random command sequences; compare real system to the model after each step (Hypothesis RuleBasedStateMachine, fast-check commands). Excellent for caches, queues, carts, DB wrappers, REST CRUD.
Reproducibility
Persist failing examples (Hypothesis .hypothesis/ DB; commit @example(...) for regression); log seeds in CI. Never mark a PBT flaky — a failure is a real counter-example (or a bad property).
Pitfalls
Re-implementing the function inside the property (tautology) · properties too weak (assert True) · non-determinism in the code under test · unbounded generators blowing runtime.
Related
unit-testing, fuzz-testing, test-design-techniques, mutation-testing
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

