[HN Gopher] Falsify: Hypothesis-Inspired Shrinking for Haskell (...
___________________________________________________________________
Falsify: Hypothesis-Inspired Shrinking for Haskell (2023)
Author : birdculture
Score : 43 points
Date : 2025-04-20 19:41 UTC (3 hours ago)
(HTM) web link (www.well-typed.com)
(TXT) w3m dump (www.well-typed.com)
| sshine wrote:
| How does Hedgehog and Hypothesis differ in their shrinking
| strategies?
|
| The article uses the words "integrated" vs. "internal" shrinking.
|
| > the raison d'etre of internal shrinking: it doesn't matter that
| we cannot shrink the two generators independently, because we are
| not shrinking generators! Instead, we just shrink the samples
| that feed into those generators.
|
| Besides that it seems like falsify has many of the same features
| like choice of ranges and distributions.
| thesz wrote:
| This is fascinating!
|
| If I understand correctly, they approximate language of inputs of
| a function to discover minimal (in some sense, like "shortest
| description length") inputs that violate relations between inputs
| and outputs of a function under scrutiny.
| evertedsphere wrote:
| newtype Parser a = Parser ([Word] -> (a, [Word])
|
| missing a paren here
| moomin wrote:
| I'm honestly completely failing to understand the basic idea
| here. What does this look like for generating and shrinking
| random strings,
| mjw1007 wrote:
| I've found in practice that shrinking to get the "smallest amount
| of detail" is often unhelpful.
|
| Suppose I have a function which takes four string parameters, and
| I have a bug which means it crashes if the third is empty.
|
| I'd rather see this in the failure report:
|
| ("ldiuhuh!skdfh", "nd#lkgjdflkgdfg", "", "dc9ofugdl
| ifugidlugfoidufog")
|
| than this:
|
| ("", "", "", "")
| shae wrote:
| I care about the edge between "this value fails, one value over
| succeeds". I wish shrinking were fast enough to tell me if there
| are multiple edges between those values.
___________________________________________________________________
(page generated 2025-04-20 23:00 UTC)