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
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
79
Always available workspaces: Dotfiles, Github and other shenanigans
pierregoudjo
0
63
Amazon Virtual Private Cloud
pierregoudjo
0
87
Service Discovery: Fundamentals
pierregoudjo
0
87
Relational Databases on AWS: Amazon RDS and Aurora
pierregoudjo
0
110
Object storage: An exploration of AWS S3
pierregoudjo
0
78
Load Balancing: A strategy for scalable internet applications
pierregoudjo
0
100
Boring Technologies
pierregoudjo
0
64
CDN: Caching and edge computing on AWS
pierregoudjo
0
69
Other Decks in Programming
See All in Programming
<title><a id="</title>君はこのHTMLをパースできるか"></a></title> #雑LT_study
pizzacat83
0
110
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
0
130
FDEが実現するAI駆動経営の現在地
gonta
2
230
えっ!!コードを読まずに開発を!?
hananouchi
0
270
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
550
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
430
吝嗇家のためのAI活用 / AI development for miser - ChatGPT + Issue Driven Development
tooppoo
0
200
Claude Opus 4.6以後の受託開発エンジニアの変化(Claude Code開発ノウハウ大公開スペシャルbyクラスメソッド)
iidatakuma
1
880
SREの積み重ねがAI駆動開発のガードレールになった ― 7つの実践/SRE Guardrails The 7
tomoyakitaura
8
5.6k
今さら聞けない .NET CLI
htkym
0
140
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
150
php-fpmのプロセスが枯渇した日-調査・対処・そして本当にやるべきだったこと-
shibuchaaaan
0
160
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
9
920
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
64
56k
Evolving SEO for Evolving Search Engines
ryanjones
0
250
The Cult of Friendly URLs
andyhume
79
7k
Site-Speed That Sticks
csswizardry
13
1.4k
Chasing Engaging Ingredients in Design
codingconduct
0
240
A Soul's Torment
seathinner
6
3.1k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
640
Skip the Path - Find Your Career Trail
mkilby
1
170
How to Ace a Technical Interview
jacobian
281
24k
Discover your Explorer Soul
emna__ayadi
2
1.2k
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