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
Property-based testing: The lazy programmer's g...
Search
Pierre GOUDJO
January 20, 2022
Programming
0
98
Property-based testing: The lazy programmer's guide to writing thousands of tests
Pierre GOUDJO
January 20, 2022
Tweet
Share
More Decks by Pierre GOUDJO
See All by Pierre GOUDJO
Simplicity matters
pierregoudjo
0
60
Always available workspaces: Dotfiles, Github and other shenanigans
pierregoudjo
0
49
Amazon Virtual Private Cloud
pierregoudjo
0
72
Service Discovery: Fundamentals
pierregoudjo
0
79
Relational Databases on AWS: Amazon RDS and Aurora
pierregoudjo
0
96
Object storage: An exploration of AWS S3
pierregoudjo
0
62
Load Balancing: A strategy for scalable internet applications
pierregoudjo
0
90
Boring Technologies
pierregoudjo
0
51
CDN: Caching and edge computing on AWS
pierregoudjo
0
60
Other Decks in Programming
See All in Programming
ALL CODE BASE ARE BELONG TO STUDY
uzulla
1
170
Go言語の特性を活かした公式MCP SDKの設計
hond0413
1
230
Pull-Requestの内容を1クリックで動作確認可能にするワークフロー
natmark
2
490
CSC305 Lecture 06
javiergs
PRO
0
220
(Extension DC 2025) Actor境界を越える技術
teamhimeh
1
250
Android16 Migration Stories ~Building a Pattern for Android OS upgrades~
reoandroider
0
100
2分台で1500examples完走!爆速CIを支える環境構築術 - Kaigi on Rails 2025
falcon8823
3
3.6k
What's new in Spring Modulith?
olivergierke
1
140
All About Angular's New Signal Forms
manfredsteyer
PRO
0
120
CSC509 Lecture 06
javiergs
PRO
0
260
Domain-centric? Why Hexagonal, Onion, and Clean Architecture Are Answers to the Wrong Question
olivergierke
2
820
理論と実務のギャップを超える
eycjur
0
130
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
The Power of CSS Pseudo Elements
geoffreycrofte
79
6k
A Modern Web Designer's Workflow
chriscoyier
697
190k
Rails Girls Zürich Keynote
gr2m
95
14k
Practical Orchestrator
shlominoach
190
11k
Building Better People: How to give real-time feedback that sticks.
wjessup
369
20k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Embracing the Ebb and Flow
colly
88
4.8k
Context Engineering - Making Every Token Count
addyosmani
5
230
Why Our Code Smells
bkeepers
PRO
339
57k
Producing Creativity
orderedlist
PRO
347
40k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Transcript
Pierre Goudjo Property-based testing The lazy programmer's guide to writing
thousands of tests
“Real-life” Scenario
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
Solution
What’s an addition?
None
None
Properties Addition • Associativity: x+(y+z) = (x+y)+z • Commutativity: x
+ y = y + x • Identity Element: x+0 = x
This is property-based testing
for any (x, y, …) such as precondition(x, y, …)
holds property(x, y, …) is true
Let’s implement this!!!!
Is it useful?
Avg • for any number (a and b ) •
such a <= b • a <= avg(a, b) and avg(a, b) <= b • for any number (a and b ) • such a <= b • avg(a, b) == avg(a, b)
Zip/Unzip • for any string (x) • such as x
not “” • unzip(zip(x)) == x is true