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
100
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
63
Always available workspaces: Dotfiles, Github and other shenanigans
pierregoudjo
0
53
Amazon Virtual Private Cloud
pierregoudjo
0
77
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
67
Load Balancing: A strategy for scalable internet applications
pierregoudjo
0
98
Boring Technologies
pierregoudjo
0
54
CDN: Caching and edge computing on AWS
pierregoudjo
0
62
Other Decks in Programming
See All in Programming
テレメトリーシグナルが導くパフォーマンス最適化 / Performance Optimization Driven by Telemetry Signals
seike460
PRO
2
200
Agentic AI: Evolution oder Revolution
mobilelarson
PRO
0
220
我々はなぜ「層」を分けるのか〜「関心の分離」と「抽象化」で手に入れる変更に強いシンプルな設計〜 #phperkaigi / PHPerKaigi 2026
shogogg
2
720
飯MCP
yusukebe
0
420
Smarter Angular mit Transformers.js & Prompt API
christianliebel
PRO
1
110
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
820
野球解説AI Agentを開発してみた - 2026/02/27 LayerX社内LT会資料
shinyorke
PRO
0
380
Coding as Prompting Since 2025
ragingwind
0
550
Codex CLIのSubagentsによる並列API実装 / Parallel API Implementation with Codex CLI Subagents
takatty
2
730
Everything Claude Code OSS詳細 — 5層構造の中身と導入方法
targe
0
160
Cyrius ーLinux非依存にコンテナをネイティブ実行する専用OSー
n4mlz
0
260
条件判定に名前、つけてますか? #phperkaigi #c
77web
2
880
Featured
See All Featured
Docker and Python
trallard
47
3.8k
Producing Creativity
orderedlist
PRO
348
40k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
The Language of Interfaces
destraynor
162
26k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
270
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.4k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Unsuck your backbone
ammeep
672
58k
Ruling the World: When Life Gets Gamed
codingconduct
0
190
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