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
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Property-based testing: The lazy programmer's guide to writing thousands of tests
Pierre GOUDJO
January 20, 2022
More Decks by Pierre GOUDJO
See All by Pierre GOUDJO
Simplicity matters
pierregoudjo
0
83
Always available workspaces: Dotfiles, Github and other shenanigans
pierregoudjo
0
65
Amazon Virtual Private Cloud
pierregoudjo
0
91
Service Discovery: Fundamentals
pierregoudjo
0
88
Relational Databases on AWS: Amazon RDS and Aurora
pierregoudjo
0
110
Object storage: An exploration of AWS S3
pierregoudjo
0
81
Load Balancing: A strategy for scalable internet applications
pierregoudjo
0
100
Boring Technologies
pierregoudjo
0
66
CDN: Caching and edge computing on AWS
pierregoudjo
0
73
Other Decks in Programming
See All in Programming
React本体のコードリーディング
high_g_engineer
1
160
Loosening the Reins: Go Generics Get More Flexible
kuro_kurorrr
0
330
Cloudflare is Agents
chimame
0
180
AI時代に学ぶ 好きなルール 嫌いなルール Linter編
shorty5121
0
160
170k Jobs a Day on GKE: Scaling Mercari's CI Platform - and What's Next for AI-Native Development
junyaokabe
0
120
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
400
レビュー履歴をAIに食わせて、 Compose移行を加速するs
shihochan
0
220
Flow は今どうなっているか
mizdra
PRO
0
720
S3 を使うアプリケーションをローカル完結で動かすことに全力を注いでみた / Running S3 Apps Offline
contour_gara
0
630
freee が目指す データ マネジメント戦略 AI-Ready 時代を支える 攻めのガバナンスとは
freee
PRO
0
500
Go 1.27からのGODEBUG / Go 1.27 リリースパーティ #go127party
mazrean
0
230
go-spidermonkeyでAIエージェントのCode Modeを実装する
syumai
2
1.2k
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
970
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
The SEO identity crisis: Don't let AI make you average
varn
0
540
Ruling the World: When Life Gets Gamed
codingconduct
0
310
ラッコキーワード サービス紹介資料
rakko
1
4.5M
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
Google's AI Overviews - The New Search
badams
0
1.6k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
400
Test your architecture with Archunit
thirion
2
2.4k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.5k
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