Claude Code property-based-testing for serialization round trips
Define an observable property for a parser or formatter, generate inputs, and report counterexamples when reconstruction fails.
中文Install in Claude Code
Use Claude Code with a pure function or local tests in your own project. Use existing fast-check or Hypothesis, or begin with a bounded set of representative fixtures.
- Review `.claude/skills/property-based-testing/SKILL.md` and its requirements at the pinned GitHub commit.
- Create `.claude/skills/property-based-testing/` in your project and save the reviewed file as `.claude/skills/property-based-testing/SKILL.md`.
- Start Claude Code from that project's root, then select `/property-based-testing` in the slash menu.
Example task
Check local serialization with {labels: ['Garden', 'livre ancien', '']}. The property is that parsing the serialized output reconstructs the original value.What to check
Report {property: 'roundTrip', passed: true} only when the fixture ran and passed. If the empty string disappears, show the failing input and difference.
Original SKILL.md on GitHub · Updated
Frequently asked question
Does a generated test prove that every input passes?
It covers more representative structures and boundaries. State the tested input domain and preserve a reproducible example when a failure occurs.