Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Lunch & Learn - Property Based Testing
Search
Mickael Metesreau
December 21, 2016
Programming
0
58
Lunch & Learn - Property Based Testing
Mickael Metesreau
December 21, 2016
Tweet
Share
More Decks by Mickael Metesreau
See All by Mickael Metesreau
Fear the Ponies
mmetesreau
0
160
Alt.Net Talks - Make type system great again
mmetesreau
0
87
Alt.Net Talks - The Actor Model
mmetesreau
0
51
Betclic Dojo - Where is Fluffy?
mmetesreau
0
74
Mini training - EventStore
mmetesreau
0
66
Alt.Net Talks - EdgeJs
mmetesreau
0
300
Betclic Dojo - Extreme Carpaccio
mmetesreau
0
130
Betclic Dojo - Game of life
mmetesreau
0
39
Mini training - Containerization and Docker
mmetesreau
0
430
Other Decks in Programming
See All in Programming
なぜあの開発者はDevRelに伴走し続けるのか / Why Does That Developer Keep Running Alongside DevRel?
nrslib
3
400
CSC305 Lecture 03
javiergs
PRO
0
240
Range on Rails ―「多重範囲型」という新たな選択肢が、複雑ロジックを劇的にシンプルにしたワケ
rizap_tech
0
130
他言語経験者が Golangci-lint を最初のコーディングメンターにした話 / How Golangci-lint Became My First Coding Mentor: A Story from a Polyglot Programmer
uma31
0
120
CSC305 Lecture 04
javiergs
PRO
0
270
Building, Deploying, and Monitoring Ruby Web Applications with Falcon (Kaigi on Rails 2025)
ioquatix
4
2.1k
タスクの特性や不確実性に応じた最適な作業スタイルの選択(ペアプロ・モブプロ・ソロプロ)と実践 / Optimal Work Style Selection: Pair, Mob, or Solo Programming.
honyanya
3
170
Goで実践するドメイン駆動開発 AIと歩み始めた新規プロダクト開発の現在地
imkaoru
4
840
What's new in Spring Modulith?
olivergierke
1
150
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
330
After go func(): Goroutines Through a Beginner’s Eye
97vaibhav
0
390
iOSエンジニア向けの英語学習アプリを作る!
yukawashouhei
0
200
Featured
See All Featured
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
30
2.9k
Embracing the Ebb and Flow
colly
88
4.8k
Typedesign – Prime Four
hannesfritz
42
2.8k
Documentation Writing (for coders)
carmenintech
75
5.1k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.7k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
jQuery: Nuts, Bolts and Bling
dougneiner
65
7.9k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
33
2.3k
Transcript
Lunch & Learn Property based Testing
What is a Property? Something always true in a given
context
Could be Strong The total is the sum of the
elements The answer is always 42 …
But most of the time, it’s weak The appointment is
always in the future The invoice is never negative …
A test only validate one specific case
Wait, we also have parameterized tests
Yes but we go further with random generators
Let me introduce FsCheck A port of Haskell’s Quickcheck for
.NET
Generator: easily generates a number of random values for many
types Shrinker: tries to find the mininal counter example that still fails the property
None
Property based testing don’t replace unit testing
Property based testing test a lot of random cases cheaply
Random??? So what does green mean? Testing show the presence,
not the absence of bug E. W. Dijktra
Finding good properties is hard
But it is worth to think about general properties of
your business
Thanks QuickCheck: A Lightweight Tool for Random Testing of Haskell
Programs http://www.cs.tufts.edu/~nr/cs257/archive/john-hughes/quick.pdf An introduction to property-based testing http://fsharpforfunandprofit.com/posts/property-based-testing/ FsCheck https://fscheck.github.io/FsCheck/