tiny.hypothesis
Overview · API · Code relationships · Verification · Audit
Overview
Runs tests by searching for inputs that make a test fail. A function that draws its inputs and fails when the claim under test fails for them is a property. Every draw goes through the run's data object, which appends the choice with its kind, its value, and the bounds it was drawn within. The recorded list of the draws a property made is the choice sequence. Because the draws are recorded in order, a later run can feed the same sequence back into the same generator and get the same input.
The search for a smaller choice sequence that still fails is shrinking. A generator can label a range of the choice sequence, opened and closed around a part of the generator, as a span, which gives shrinking a unit to delete or simplify. Shrinking replays a candidate sequence through the property and keeps the candidate when the property still fails, within the run's shrink budget. The passes delete spans, replace a span with its simplest value, and reduce individual choices.
A property can report a finite number to say how interesting its input was as a target score, and the engine then spends a further budget mutating the best-scoring sequence to raise that score.
A failing sequence is saved to the directory called the failure database and replayed first on the next run. Limits for one run, called settings, bound a run by examples, replays, choices, input bytes, shrinks, and targeted attempts, with quick, dev, and ci presets scaling all of them together.
Definitions
Actions
Public operations.
StrategyBoundedArrayfuzzWithSettingstargetcheckcheckNamedforAllforAllNamedfuzzcheckFnautoGeneratorfixedArrayfloat32checkValuecheckValueAlloclisttuplebytesfloat64integeroneOfbooleangen_pointgen_quaterniongen_unit_vec3
Types and contracts
Public types and contracts.
ConjectureDataSettingsCoverageCountsChoiceKindChoiceNodeConfigDrawErrorSpanStatusTargetErrorTargetObservationFuzzInputOptionsReplayCursorCoverageTestResult
Namespaces
Public namespaces.
conjecturecoverageartifactdatabasestrategiesswarmshrinkerengineautoderivevaluecompositesreportstateful
Code relationships
Direct static dependencies extracted from parsed source by semantic graph analysis.
Uses: tiny.bench, tiny.bumpalo, tiny.smg
Used by: tiny.accy, tiny.arrange, tiny.bench, tiny.bumpalo, tiny.chant, tiny.choir, tiny.closure, tiny.coz, tiny.css, tiny.deadalloc, tiny.deflate, tiny.filigree, tiny.geometry, tiny.gif, tiny.gpalloc, tiny.gui, tiny.http, tiny.linear, tiny.machine, tiny.markdown, tiny.memtrace, tiny.mprompt, tiny.pdf, tiny.peer, tiny.pluck, tiny.png, tiny.preserves, tiny.python, tiny.quic, tiny.reducer, tiny.reticulum, tiny.rig, tiny.sandbox, tiny.sdfii, tiny.simd, tiny.smt, tiny.sql, tiny.stabilizer, tiny.stun, tiny.syn, tiny.sys, tiny.tldr, tiny.trace, tiny.ui, tiny.wayland, tiny.windowing, tiny.xkb
Verification
No verification records are cataloged for this module in this build.
Audit
| Evidence | Value |
|---|---|
| Source | lib/hypothesis/src/root.zig |
| Definitions | 0 of 54 documented |
| Members | 0 of 0 documented |
| Public names | 54 API, 254 indexed |
| Version | 26.7.0 |
| Revision | daab053ee433 |
| Unresolved targets | 1 |