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
97
Object storage: An exploration of AWS S3
pierregoudjo
0
63
Load Balancing: A strategy for scalable internet applications
pierregoudjo
0
90
Boring Technologies
pierregoudjo
0
52
CDN: Caching and edge computing on AWS
pierregoudjo
0
60
Other Decks in Programming
See All in Programming
オープンソースソフトウェアへの解像度🔬
utam0k
18
3.2k
Temporal Knowledge Graphで作る! 時間変化するナレッジを扱うAI Agentの世界
po3rin
5
1.1k
Developer Joy - The New Paradigm
hollycummins
1
400
Amazon ECS Managed Instances が リリースされた!キャッチアップしよう!! / Let's catch up Amazon ECS Managed Instances
cocoeyes02
0
120
TransformerからMCPまで(現代AIを理解するための羅針盤)
mickey_kubo
7
5.8k
CSC305 Lecture 11
javiergs
PRO
0
320
CSC509 Lecture 08
javiergs
PRO
0
270
三者三様 宣言的UI
kkagurazaka
0
320
フロントエンド開発のためのブラウザ組み込みAI入門
masashi
7
3.6k
Amazon Verified Permissions実践入門 〜Cedar活用とAppSync導入事例/Practical Introduction to Amazon Verified Permissions
fossamagna
2
110
Inside of Swift Export
giginet
PRO
1
250
Software Architecture
hschwentner
6
2.4k
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
34
8.9k
Why You Should Never Use an ORM
jnunemaker
PRO
60
9.6k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.5k
Stop Working from a Prison Cell
hatefulcrawdad
272
21k
The Pragmatic Product Professional
lauravandoore
36
7k
Done Done
chrislema
186
16k
Music & Morning Musume
bryan
46
6.9k
RailsConf 2023
tenderlove
30
1.3k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Building Adaptive Systems
keathley
44
2.8k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.7k
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