Skip to content

Keeping the corpus

The corpus is the inputs worth trying first, kept from earlier counterexamples, so a pull request checks what a nightly run found. It’s a cache, so it isn’t committed, and machines each grow their own: CI’s, yours. proptastic corpus shows what’s kept, merges in another machine’s, and prunes what’s no longer worth running.

Each output here is what the command printed on a calendar sample.

Terminal window
proptastic corpus
Inputs kept ───────────────────────────────────────────────────────────
CalendarTest#everyMonthHasAtLeast28Days none
CalendarTest#followsTheLeapYearRule none
CalendarTest#novemberHas30Days 5 inputs · 2 stale
! 2 orphans, directories no property here uses
calendar.CalendarTest#novemberHasThirtyDays() 1 input: renamed tests? give them .id(…)
id.leap-years 1 input: an .id(…) changed, or its property is gone
proptastic corpus --prune drops them; nothing does it unasked.
Corpus .proptastic/corpus
Kept 5 inputs kept for 1 property · 2 stale · 2 orphans
the corpus is a cache; a fuzz run rebuilds it

A directory no property uses any more is an orphan. It’s never dropped unsaid: the list names its likely cause, a test renamed or moved, which an .id(…) on the property would have kept, or an id changed.

CI’s corpus, downloaded as an artifact, merges in. Entries are named by their choices’ hash, so one input found on two machines is one file:

Terminal window
proptastic corpus --merge=ci-corpus
merged 3 new inputs from ci-corpus into 3 properties' corpora; 1 was kept already, by name.
the corpus is a cache; a fuzz run rebuilds it

--prune drops the orphans, re-keys stale entries whose choices still mean the same input and drops the rest, keeps the fewest entries that still catch every mutant any entry caught, from mutastic’s record, and holds each property to 16 entries:

Terminal window
PROPTASTIC_CORPUS_MATRIX=matrix.tsv proptastic corpus --prune
dropped 2 orphans: calendar.CalendarTest#novemberHasThirtyDays() and id.leap-years.
of the stale entries, 1 still decodes and was re-keyed; 1 didn't, and was dropped.
the minimal cover from matrix.tsv keeps 1 input that catches every mutant any entry caught; 2 dropped.
each property holds at most 16; 0 past it dropped.
the corpus is a cache; a fuzz run rebuilds it. A prune has no undo.

proptastic corpus has every option.

Privacy