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
93
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
58
Always available workspaces: Dotfiles, Github and other shenanigans
pierregoudjo
0
48
Amazon Virtual Private Cloud
pierregoudjo
0
72
Service Discovery: Fundamentals
pierregoudjo
0
78
Relational Databases on AWS: Amazon RDS and Aurora
pierregoudjo
0
92
Object storage: An exploration of AWS S3
pierregoudjo
0
56
Load Balancing: A strategy for scalable internet applications
pierregoudjo
0
84
Boring Technologies
pierregoudjo
0
49
CDN: Caching and edge computing on AWS
pierregoudjo
0
58
Other Decks in Programming
See All in Programming
High-Level Programming Languages in AI Era -Human Thought and Mind-
hayat01sh1da
PRO
0
390
なんとなくわかった気になるブロックテーマ入門/contents.nagoya 2025 6.28
chiilog
1
220
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
46
31k
Azure AI Foundryではじめてのマルチエージェントワークフロー
seosoft
0
130
0626 Findy Product Manager LT Night_高田スライド_speaker deck用
mana_takada
0
110
生成AIコーディングとの向き合い方、AIと共創するという考え方 / How to deal with generative AI coding and the concept of co-creating with AI
seike460
PRO
1
330
明示と暗黙 ー PHPとGoの インターフェイスの違いを知る
shimabox
2
320
なぜ適用するか、移行して理解するClean Architecture 〜構造を超えて設計を継承する〜 / Why Apply, Migrate and Understand Clean Architecture - Inherit Design Beyond Structure
seike460
PRO
1
690
イベントストーミング図からコードへの変換手順 / Procedure for Converting Event Storming Diagrams to Code
nrslib
1
420
型付きアクターモデルがもたらす分散シミュレーションの未来
piyo7
0
810
PHP 8.4の新機能「プロパティフック」から学ぶオブジェクト指向設計とリスコフの置換原則
kentaroutakeda
2
560
ASP.NETアプリケーションのモダナイズ インフラ編
tomokusaba
1
410
Featured
See All Featured
A designer walks into a library…
pauljervisheath
207
24k
How to Ace a Technical Interview
jacobian
277
23k
Making Projects Easy
brettharned
116
6.3k
Scaling GitHub
holman
459
140k
RailsConf 2023
tenderlove
30
1.1k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
Into the Great Unknown - MozCon
thekraken
39
1.9k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
Being A Developer After 40
akosma
90
590k
Designing for Performance
lara
609
69k
Statistics for Hackers
jakevdp
799
220k
Gamification - CAS2011
davidbonilla
81
5.3k
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