原文
| ||||||||||
| ||||||||||
![]() |
原始链接: https://news.ycombinator.com/item?id=43746017
这篇 Hacker News 讨论帖讨论了 Falsify,一个新的 Haskell 属性测试库,它具有受 Hypothesis 启发的收缩功能。其核心概念是“内部收缩”,即收缩的是提供给生成器的样本,而不是生成器本身。 用户 sshine 询问了 Falsify 的收缩方法与 Hedgehog 和 Hypothesis 的区别。thesz 发现 Falsify 通过逼近函数输入的语言来寻找最小违反输入的方法“令人着迷”。 mjw1007 认为收缩到尽可能小的细节可能没有帮助,他更喜欢突出导致错误的特定输入的失败报告,即使该输入比较大。Gwern 反驳说,最小示例更容易理解和调试。dullcrisp 建议理想情况下,收缩应该隔离“特殊”值。shae 希望更快的收缩能够识别失败值和成功值之间的精确边界。该讨论帖还指出了代码片段中缺少的括号,moomin 则寻求 Falsify 如何处理字符串生成和收缩的澄清。
| ||||||||||
| ||||||||||
![]() |
The 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.
reply