TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The Design and Use of QuickCheck

147 pointsby begriffsalmost 8 years ago

7 comments

tmoertelalmost 8 years ago
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>
moominalmost 8 years ago
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.
davnnalmost 8 years ago
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__almost 8 years ago
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 未加载
lacampbellalmost 8 years ago
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_dhalmost 8 years ago
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 未加载
toshalmost 8 years ago
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>