Skip to content

proptastic fuzz

Search for a counterexample for as long as you allow, the corpus first: coverage-guided when its worker runs, else rounds of the build, and it says which. Coverage-guided, its worker runs on the tests' own class path with the agent counting the branches --cover's packages reach, and says how many of those loaded were reached; without a worker it can start, it runs the build in rounds, a fresh seed each, and says why on its first line. It stops when the time runs out, at the first counterexample, or on Ctrl-C, keeping the corpus. It never says a property passed.

Usage

Terminal window
proptastic fuzz [DIR] [OPTIONS]
Terminal window
proptastic fuzz --for=30m
proptastic fuzz --for=2h --only=sortKeepsSize

Output

As the command printed it, run on a sample project: each is held to a real run by the command's own tests.

Terminal window
proptastic fuzz --for=20s --only=anyBytesReadAsAHeaderOrNone
Found ─────────────────────────────────────────────────────────────────
✗ HeaderTest#anyBytesReadAsAHeaderOrNone counterexample c657fb13a
anyBytesReadAsAHeaderOrNone failed after 3,112 tries of a search (seed 0xcd66f10181a3a6e4)
shrunk counterexample: bytes = HexFormat.of().parseHex("cafebabe0000")
pin it: .example(HexFormat.of().parseHex("cafebabe0000"))
rerun: proptastic run --only='codec.HeaderTest#anyBytesReadAsAHeaderOrNone()' --seed=0xcd66f10181a3a6e4
Next: proptastic example c657fb13a · or propose: proptastic example c657fb13a --propose --reason="<why>"
Reports build/proptastic/report/report.json · build/proptastic/report/index.html
searched 1.0s · 3,112 tries · found c657fb13a
Terminal window
proptastic fuzz --for=4s
searched 1.0s · 83,645 tries · 11 of 43 branches in codec · nothing found

Exit status

0 when the time ran out and nothing was found; 1 for a counterexample; 2 for a mistake in the command, the environment or a file, or a build proptastic couldn't read; 3 when a pinned example or saved counterexample failed before the search began, or an input hung; 4 when proptastic itself went wrong; 130 when stopped with Ctrl-C; the corpus is kept. The errors behind 2, 3 and the refusals are on Command errors; every code is on Environment and exit codes.

Options

--only=PROPERTY

Only this property, by its id as the manifest has it, or by its name alone when exactly one property has that name.

Terminal window
proptastic fuzz --only=SortTest#sortKeepsSize

--at=PATH:LINE

Only the property whose forAll is on this line.

Terminal window
proptastic fuzz --at=src/test/java/shop/SortTest.java:31

--edition=EDITION

Which edition's build to run, when DIR's build files could be either's.

One of java, rust, swift.

Terminal window
proptastic fuzz --edition=java

--tries=N

Tries per property, in place of the profile's; fuzz stops searching a property after that many. Sets PROPTASTIC_TRIES.

Terminal window
proptastic fuzz --tries=10000

--for=DURATION

How long fuzz searches, such as 30m or 2h, split into each property's PROPTASTIC_BUDGET round by round; until Ctrl-C when not given.

Terminal window
proptastic fuzz --for=30m

--cover=PACKAGES

The packages coverage-guided fuzz counts branches in, comma-separated; the properties' test classes' packages when not given.

Terminal window
proptastic fuzz --for=30m --cover=com/example/codec

--workers=N

How many workers search at once, each on its own properties; 1 when not given.

Terminal window
proptastic fuzz --for=1h --workers=4

--report=KIND[:PATH]

proptastic's own report of the run, beside the build's test report: json, html or sarif, each into report/ in proptastic's directory unless a path follows the kind, or none; json and html when not given.

One of json, html, sarif, none.

Terminal window
proptastic fuzz --report=json

--format=FORMAT

How proptastic answers: agent for coding agents, jsonl for tools; full on a terminal, concise elsewhere.

One of full, concise, agent, jsonl.

When it isn't given: PROPTASTIC_FORMAT, PROPTASTIC_AGENT.

Terminal window
proptastic fuzz --format=agent

--color=WHEN

Sets PROPTASTIC_COLOR: whether what proptastic and the properties print is in colour, auto when not given.

One of auto, always, never.

When it isn't given: PROPTASTIC_COLOR, NO_COLOR, FORCE_COLOR.

Terminal window
proptastic fuzz --color=never

--progress=STYLE

How fuzz shows it's searching; auto when not given.

One of auto, bar, counter, none.

When it isn't given: PROPTASTIC_PROGRESS.

Terminal window
proptastic fuzz --for=30m --progress=counter

Privacy