falsify: Internal Shrinking Reimagined for Haskell

PROCEEDINGS OF THE 16TH ACM SIGPLAN INTERNATIONAL SYMPOSIUM ON HASKELL, HASKELL 2023(2023)

引用 0|浏览0
暂无评分
摘要
In unit testing we apply the function under test to known inputs and check for known outputs. By contrast, in property based testing we state properties relating inputs and outputs, apply the function to random inputs, and verify that the property holds; if not, we found a bug. Randomly generated inputs tend to be large and should therefore be minimised. Traditionally this is done with an explicitly provided shrinker, but in this paper we propose a way to write generators that obsoletes the need to write a separate shrinker. Inspired by the Python library Hypothesis, the approach can work even across monadic bind. Compared to Hypothesis, our approach is more suitable to the Haskell setting: it depends on a minimal set of core principles, and handles generation and shrinking of infinite data structures, including functions.
更多
查看译文
关键词
property based testing,internal shrinking,functional programming
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要