Skip to content
Back to skills

Property Test

ASecurity

Add property-based tests that assert invariants across generated inputs instead of fixed examples

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 3, 2026
ai-agentsgoexpresstesting

Security analysis

A100/100

Scanned September 3, 2026

npx -y skills add black141312/ada --skill property-test --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Property Test?

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

Security grade badge for Property Test
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/black141312-property-test/badge)](https://www.skillsdirectory.com/skills/black141312-property-test)

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
---
name: property-test
description: Add property-based tests that assert invariants across generated inputs instead of fixed examples
category: testing
---

# Property Test

Use when a function has properties that must hold for all inputs, and example-based tests miss edge cases.

1. State the invariant in plain language (e.g. "decode(encode(x)) == x", "output is always sorted", "result never negative").
2. Pick a property-based library for the language (Hypothesis, fast-check, QuickCheck) and define a generator for the input domain.
3. Express the property as a test: generate inputs, run the code, assert the invariant holds for every case.
4. Constrain generators to valid inputs only (filters/preconditions) so failures reflect real bugs, not invalid data.
5. Run it; when it finds a failure, let the framework shrink to the minimal counterexample and inspect that case.
6. Fix the bug, then pin the shrunk counterexample as an explicit regression example test.

## Rules
- Test true invariants — round-trips, idempotence, ordering, conservation — not restatements of the implementation.
- Make generators match the real input domain; over-broad generators produce noise, over-narrow ones miss bugs.
- Always capture the shrunk counterexample as a permanent example-based regression test once fixed.
- Seed the RNG or record failing seeds so a found failure is reproducible, not a one-off in CI.
- Keep run counts reasonable in CI; raise iterations for a focused hunt, not on every commit.

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.

Comments

Loading comments…

Newsletter

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