Falsify: Hypothesis-Inspired Shrinking for Haskell (2023)
1–10 of 20 posts
Re: Falsify: Hypothesis-Inspired Shrinking for Haskell (2023)
#2The article uses the words "integrated" vs. "internal" shrinking.
> the raison d’être 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.
Re: Falsify: Hypothesis-Inspired Shrinking for Haskell (2023)
#3If 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.
Re: Falsify: Hypothesis-Inspired Shrinking for Haskell (2023)
#4 newtype Parser a = Parser ([Word] -> (a, [Word])
missing a paren hereRe: Falsify: Hypothesis-Inspired Shrinking for Haskell (2023)
#5Re: Falsify: Hypothesis-Inspired Shrinking for Haskell (2023)
#6Re: Falsify: Hypothesis-Inspired Shrinking for Haskell (2023)
#7Suppose 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:
("", "", "", "")
Re: Falsify: Hypothesis-Inspired Shrinking for Haskell (2023)
#8Re: Falsify: Hypothesis-Inspired Shrinking for Haskell (2023)
#9I'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: ("", "", "", "")
Re: Falsify: Hypothesis-Inspired Shrinking for Haskell (2023)
#10I'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: ("", "", "", "")
Really? Your examples seem the opposite. I am left immediately thinking, "hm, is it failing on a '!', some sort of shell issue? Or is it truncating the string on '#', maybe? Or wait, there's a space in the third one, that looks pretty dangerous, as well as noticeably longer so there could be a length issue..." As opposed to the shrunk version where I immediately think, "uh oh: one of them is not handling an empty inp…
I guess if we were even more clever we could get to something more like (…, …, "", …).