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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Pierre GOUDJO
January 20, 2022
Programming
0
100
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
61
Always available workspaces: Dotfiles, Github and other shenanigans
pierregoudjo
0
52
Amazon Virtual Private Cloud
pierregoudjo
0
75
Service Discovery: Fundamentals
pierregoudjo
0
81
Relational Databases on AWS: Amazon RDS and Aurora
pierregoudjo
0
98
Object storage: An exploration of AWS S3
pierregoudjo
0
66
Load Balancing: A strategy for scalable internet applications
pierregoudjo
0
97
Boring Technologies
pierregoudjo
0
53
CDN: Caching and edge computing on AWS
pierregoudjo
0
62
Other Decks in Programming
See All in Programming
「やめとこ」がなくなった — 1月にZennを始めて22本書いた AI共創開発のリアル
atani14
0
370
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
15
3k
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
250
Agent Skills Workshop - AIへの頼み方を仕組み化する
gotalab555
15
8.5k
オブザーバビリティ駆動開発って実際どうなの?
yohfee
3
820
nuget-server - あなたが必要だったNuGetサーバー
kekyo
PRO
0
230
AIコーディングの理想と現実 2026 | AI Coding: Expectations vs. Reality 2026
tomohisa
0
1.2k
20260313 - Grafana & Friends Taipei #1 - Kubernetes v1.36 的開發雜記:那些困在 Alpha 加護病房太久的 Metrics
tico88612
0
150
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
540
GC言語のWasm化とComponent Modelサポートの実践と課題 - Scalaの場合
tanishiking
0
110
Claude Code Skill入門
mayahoney
0
230
AI時代でも変わらない技術コミュニティの力~10年続く“ゆるい”つながりが生み出す価値
n_takehata
2
720
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
330
40k
The Pragmatic Product Professional
lauravandoore
37
7.2k
Heart Work Chapter 1 - Part 1
lfama
PRO
5
35k
Leo the Paperboy
mayatellez
4
1.5k
For a Future-Friendly Web
brad_frost
183
10k
Being A Developer After 40
akosma
91
590k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
250
How to make the Groovebox
asonas
2
2k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
69
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
470
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