Skip to content
0:00 / 0:00

#property-basedtesting#quickcheck#haskell

John Hughes - How to specify it! A guide to writing properties of pure functions | Code Mesh LDN 19

Code Sync

15K subscribers • 70 videos on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • A classic. People kept recommending it from 2021 to 2024.
  • Presented by John Hughes, co-creator of Haskell and QuickCheck

Intermediate. Assumes working knowledge.

4.7K views6 years ago2 recommendations

Tools and practiceProgramming languagesTestingFunctional programmingHaskell

John Hughes presents five strategies for writing properties in property-based testing and compares their effectiveness using QuickCheck.

This video was recorded at Code Mesh LDN 19 - bit.ly/37xc3Nr Get involved in Code Sync's next conference - bit.ly/2Mcm4aS --- HOW TO SPECIFY IT! A GUIDE TO WRITING PROPERTIES OF PURE FUNCTIONS by John Hughes ABSTRACT Property-based testing is an appealing approach to testing, but requires developers to identify suitable properties to test--and many find this difficult, and find the simple properties in tutorials difficult to generalize. In this talk, I'll present five different strategies for coming up with properties of pure functions, and I'll compare their effectiveness as tests; I'll also warn of the biggest pitfall to be avoided. You'll leave my talk with new ideas for writing properties of your own functions. I'll be using the Haskell version of QuickCheck for my examples, but the ideas are usable with any property-based testing tool. Slides & full abstract: codesync.global/speaker/john-hughes/ --- THE SPEAKER - JOHN HUGHES Co-designer of Haskell and QuickCheck John Hughes has been a functional programming enthusiast for more than thirty years, at the Universities of Oxford, Glasgow, and since 1992 Chalmers University in Gothenburg, Sweden. He served on the Haskell design committee, co-chairing the committee for Haskell 98, and is the author of more than 100 papers, including "Why Functional Programming Matters", one of the classics of the area. With Koen Claessen, he created QuickCheck, the most popular testing tool among Haskell programmers, and in 2006 he founded Quviq to commercialise the technology using Erlang. In 2018 he became an ACM Fellow. More on John Hughes: codesync.global/speaker/john-hughes/ --- CODE SYNC & CODE MESH LDN 19 Code Mesh LDN is powered by Code Sync. Code Mesh LDN 19 was sponsored by WhatsApp, Microsoft, Erlang Solutions, Juxt, aeternity, Duffel, and IOHK. CODE SYNC Website: www.codesync.global Twitter: www.twitter.com/CodeMeshIO Facebook: facebook.com/CodeSyncGlobal LinkedIn: linkedin.com/company/code-sync/ Mail: info at codesync.global #PropertyBasedTesting #QuickCheck #JohnHughes

Why it's here

2 people recommend this

What people say. Recommended as an excellent guide to understanding and writing properties for property-based testing.

u/mugen_kanoseiin r/programming • Recommends

On “The sad state of property-based testing libraries”

An arbitrary is a combination of a generator and a shrinker. You don't *have* to provide a custom shrinker for your custom type, but sometimes it's necessary if FsCheck can't create valid shrinks. And you'll want to have tests for your generators and shrinkers too. Here is a good talk by John Hughes about PBT: link to this video

u/haierophantoin r/scala • Recommends

On “How to generate random data for tests”

dude please go and check out this talk, you're clearly don't understand what're you talking about