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 guide to writing thousands of tests
Search
Pierre GOUDJO
January 20, 2022
Programming
0
88
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
37
Always available workspaces: Dotfiles, Github and other shenanigans
pierregoudjo
0
39
Amazon Virtual Private Cloud
pierregoudjo
0
65
Service Discovery: Fundamentals
pierregoudjo
0
72
Relational Databases on AWS: Amazon RDS and Aurora
pierregoudjo
0
72
Object storage: An exploration of AWS S3
pierregoudjo
0
39
Load Balancing: A strategy for scalable internet applications
pierregoudjo
0
72
Boring Technologies
pierregoudjo
0
42
CDN: Caching and edge computing on AWS
pierregoudjo
0
39
Other Decks in Programming
See All in Programming
元気予報
suu_mire0726
0
850
[SF Ruby, March 2024] Rails on Wasm
palkan
0
360
15分間でふんわり理解するDocker @ Matsuriba MAX
ukwhatn
PRO
1
410
両面どころかインフラもTSでできるよ ~ 全方位TypeScriptによるプロダクト開発 ~
myfinder
9
3.2k
オブジェクトしこう
okuramasafumi
2
150
puregoの活用例
aethiopicuschan
0
220
Build with AI 2024 Seoul - 제로부터 시작하는 Flutter with Gemini 생활 - 박제창
itsmedreamwalker
0
200
受託開発でGitLab CI を活用していく
xiombatsg
1
260
Javaエンジニアのための Nodejs/Nuxt3入門
hidekatsu_izuno
0
260
DMMプラットフォームがTiDB Cloudを採用した背景
pospome
5
2k
9年開発を牽引して見えてきた、共通化すべきものと個別でつくるもの ~プログラム言語~
shinout
1
640
オブジェクト指向のリ・オリエンテーション~歴史を振り返り、AI時代に向きなおる~
hanyudaeiiti
9
5.5k
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
39
4.4k
Fantastic passwords and where to find them - at NoRuKo
philnash
35
2.5k
GraphQLの誤解/rethinking-graphql
sonatard
49
9.2k
Designing with Data
zakiwarfel
95
4.8k
Stop Working from a Prison Cell
hatefulcrawdad
265
19k
Designing the Hi-DPI Web
ddemaree
275
33k
For a Future-Friendly Web
brad_frost
171
8.9k
Writing Fast Ruby
sferik
619
60k
Debugging Ruby Performance
tmm1
69
11k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Teambox: Starting and Learning
jrom
127
8.4k
What the flash - Photography Introduction
edds
64
11k
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