generative-property

Generates property-based and combinatorial tests using fast-check and covering arrays in TypeScript.

Updated Jun 24, 2026
One-click install
npx skills add https://github.com/Hakkadaikon/hymme --skill generative-property-hakkadaikon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: generative-property
Source: https://github.com/Hakkadaikon/hymme/tree/main/skills/generative-property
Command: npx skills add https://github.com/Hakkadaikon/hymme --skill generative-property-hakkadaikon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Testing code where expected outputs are hard to write by hand—such as serializers, parsers, or multi-parameter configurations—often leaves gaps because example-based tests only cover a few fixed inputs. This Skill provides a method catalog for binding correctness through properties that hold for all inputs (property-based testing) and through small covering arrays that exercise parameter interactions (combinatorial testing). ## Core Features & Use Cases - Property-Based Testing (PBT): Enumerate invariants, round-trip relations, metamorphic relations, and known-oracle matches, then implement them with fast-check generators, fixed seeds, and shrink-based counterexample capture. - Combinatorial Testing: Define parameter axes and value domains, encode invalid-combination constraints, and generate 2-way or 3-way covering arrays with tools like pairwise libraries, ACTS, or PICT. - Use Case: When testing a JSON codec, declare the round-trip property decode(encode(x)) === x with fc.jsonValue(), fix numRuns and seed for reproducibility, and pin any shrunk minimal counterexample as a permanent regression test. ## Quick Start Ask the AI to apply the generative-property catalog to design property-based tests with fast-check for a codec or a pairwise covering array for a build matrix.

Frequently Asked Questions about generative-property

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write property-based tests with fast-check in TypeScript?

Declare a property such as a round-trip or invariant, generate inputs with wide arbitraries like fc.jsonValue(), and assert with fc.assert using fixed numRuns and seed for reproducibility. When a counterexample appears, fast-check shrinks it to a minimal failing input you can pin as a regression test.

What is pairwise testing and when should I use it?

Pairwise testing generates a small covering array where every pair of parameter values appears at least once, instead of testing all combinations. Use it when independent parameters like OS, runtime version, and mode make exhaustive combination testing explode; most interaction defects surface at 2-way strength.

What kinds of properties work for property-based testing?

Four property types apply: invariants the output always satisfies, round-trip relations like decode(encode(x)) === x, metamorphic relations between transformed inputs, and agreement with a known slow-but-correct oracle. If none of these fit, example-based testing is a better choice.

Why does my property-based test fail on -0, +0, or NaN comparisons?

Wide generators produce edge-case numbers where toBe (Object.is) treats -0 and +0 as different and NaN === NaN is always false. Define equivalence as part of the property itself, choosing ===, tolerance-based comparison, or toStrictEqual deliberately to avoid flaky failures.

When should I not use property-based testing?

Avoid PBT when the only property you can state copies the implementation's own logic, since both can be wrong simultaneously and the oracle is worthless. Also avoid it when no property type fits the target; use example-based equivalence partitioning and boundary value analysis instead.

How do I handle invalid parameter combinations in combinatorial testing?

Write constraints such as 'if os=mac then node≠18' and feed them to a constraint-aware covering array generator like ACTS or PICT. Without constraints, the generator produces many meaningless cases that fail for reasons unrelated to real defects.