Join the discussion
Write your take first — we'll ask for email only when you're ready to publish.
- Hacker News
- Author here! Let me know if I can contribute to the discussion.by alpaylan
- In section 6.1 you mention experimenting with bypassing the precondition checks for correct-by-construction generators. Have you considered giving this "unsafe" runner a type that demands a completeness certificate for the generator (in the style of https://dl.acm.org/doi/10.1145/3158133) so that this optimization is at least available only when proven sound?by jkhdigital
- Possibly of interest since it seems vaguely similar: I wrote my own property-testing framework for TypeScript that allows you to write arbitrary code provided that it's deterministic, so you don't need to mess with combinators as much. (Somewhat inspired by how React does it.)
Example:
https://github.com/skybrian/repeat-test/blob/0567a73f07ada6e...const point = arb.from((pick) => { const x = pick(arb.int(0, 100)); const y = pick(arb.int(0, 100)); return { x, y }; });It also lets you parse objects instead of generating them if you define a Domain instead of an Arbitrary, which I haven't actually needed much, but seems neat.
It does some shrinking without having to implement anything extra, but I haven't done anything with code coverage-guided generation. I'd like to try that sometime.
by skybrian - Python has Hypothesis: https://hypothesis.readthedocs.io