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
110
0
Share
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
70
Always available workspaces: Dotfiles, Github and other shenanigans
pierregoudjo
0
57
Amazon Virtual Private Cloud
pierregoudjo
0
81
Service Discovery: Fundamentals
pierregoudjo
0
83
Relational Databases on AWS: Amazon RDS and Aurora
pierregoudjo
0
100
Object storage: An exploration of AWS S3
pierregoudjo
0
70
Load Balancing: A strategy for scalable internet applications
pierregoudjo
0
98
Boring Technologies
pierregoudjo
0
60
CDN: Caching and edge computing on AWS
pierregoudjo
0
63
Other Decks in Programming
See All in Programming
継続的な負荷検証を目指して
pyama86
3
1.2k
SkillsをS3 Filesに置く時のあれこれ
watany
3
1.6k
UaaL×Androidアプリのメモリ計測 — Memory Profilerの先へ
rio432
0
160
TypeScriptだけでAIエージェントを作る フロント・エージェント・インフラのフルスタック実践
har1101
1
320
Making the RBS Parser Faster
soutaro
0
720
Kubernetesを使わない環境にもCloud Nativeなデプロイを実現する / Enabling Cloud Native deployments without the complexity of Kubernetes
linyows
3
410
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
180
PHPでローカル環境用のSSL/TLS証明書を発行することはできるのか? #phpconkagawa
akase244
0
370
Cloudflare で始める Data Platform
ta93abe
0
170
AgentCore Optimizationを始めよう!
licux
3
240
運転動画を検索可能にする〜Cosmos-Embed1とDatabricks Vector Searchで〜/cosmos-embed1-databricks-vector-search
studio_graph
3
950
AI Agent と正しく分析するための環境作り
yoshyum
2
510
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
73k
From π to Pie charts
rasagy
0
180
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Designing for humans not robots
tammielis
254
26k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
Paper Plane
katiecoart
PRO
1
50k
Discover your Explorer Soul
emna__ayadi
2
1.1k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
210
Utilizing Notion as your number one productivity tool
mfonobong
4
300
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.4k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
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