TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The Design and Use of QuickCheck

147 点作者 begriffs将近 8 年前

7 条评论

tmoertel将近 8 年前
One of my favorite examples of property-based testing is in the docs for Haskell&#x27;s Text.ParserCombinators.ReadP module. The semantics of the combinators are succinctly (but fully) documented in the form of QuickCheck properties.<p><a href="https:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;base-4.9.1.0&#x2F;docs&#x2F;Text-ParserCombinators-ReadP.html" rel="nofollow">https:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;base-4.9.1.0&#x2F;docs&#x2F;Text-P...</a>
moomin将近 8 年前
The first line sounds like hubris, but amazingly it&#x27;s actually true. QuickCheck makes extremely good (not over-complex or &#x27;clever&#x27;) use of return type polymorphism and applicatives.<p>Property testing is a good idea in any language, but its particularly elegant in Haskell.
davnn将近 8 年前
Also: it&#x27;s the coolest example of type classes Simon Peyton Jones knows and he explains why here (around 34-35 min):<p><a href="https:&#x2F;&#x2F;youtu.be&#x2F;6COvD8oynmI" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;6COvD8oynmI</a>
k__将近 8 年前
This seems to be the way to go for testing.<p>I&#x27;ve wanted to use it for my current React-Native project. I found a JS implementation AND a babel plugin that creates the tests from flow-types.<p>The question for me here is, how long does this take compared to regular testing? I read people complained about AVA because of bad test performance (it does many parallel tests).<p>Also, where to put it in the chain?<p>Should I put it pre-push, pre-build, somewhere in the CI?
评论 #14542978 未加载
lacampbell将近 8 年前
Has anyone here converted from &#x27;regular&#x27; unit testing to quickcheck, or other property-based unit testing libraries? I&#x27;m wondering if it&#x27;s worth taking the time out to learn, but I have my reservations regarding non-deterministic testing.
评论 #14542163 未加载
评论 #14543281 未加载
评论 #14542113 未加载
评论 #14542851 未加载
评论 #14542102 未加载
评论 #14542087 未加载
评论 #14542809 未加载
评论 #14553097 未加载
评论 #14542207 未加载
评论 #14542084 未加载
评论 #14542085 未加载
frou_dh将近 8 年前
In Go&#x27;s standard library there is a basic QuickCheck facility. But apparently it has only been imported by 20 opensource packages ever (see bottom of page):<p><a href="https:&#x2F;&#x2F;godoc.org&#x2F;testing&#x2F;quick" rel="nofollow">https:&#x2F;&#x2F;godoc.org&#x2F;testing&#x2F;quick</a>
评论 #14544042 未加载
评论 #14544066 未加载
tosh将近 8 年前
You might also want to look into <a href="https:&#x2F;&#x2F;clojure.org&#x2F;about&#x2F;spec" rel="nofollow">https:&#x2F;&#x2F;clojure.org&#x2F;about&#x2F;spec</a>