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
Compiler Based Testing
Search
Xavier Gouchet
April 03, 2019
Programming
1
84
Compiler Based Testing
Xavier Gouchet
April 03, 2019
Tweet
Share
More Decks by Xavier Gouchet
See All by Xavier Gouchet
Unleash your Programming Creativity
xgouchet
0
45
Demystifying the Test Pyramid
xgouchet
1
250
Successfully Publishing a Tested, Upgradeable and Documented Open Source Library
xgouchet
0
49
Property Based Testing in Practice
xgouchet
0
44
Develop your CI tools
xgouchet
2
350
How to write a safe and reliable Open Source Library
xgouchet
1
220
Benchmarking your app's performance
xgouchet
0
160
Benchmarking your app's performance
xgouchet
0
76
It's time to up your test game
xgouchet
1
110
Other Decks in Programming
See All in Programming
仕様と実装で学ぶOpenTelemetry
drumato
2
930
TypeScriptとGraphQLで実現する 型安全なAPI実装 / TSKaigi 2024
hokaccha
5
2.7k
slow types ってなんだろう?
karad
0
210
AppRouter Panel Talk
yosuke_furukawa
PRO
1
520
Direct Style Effect Systems The Print[A] ExampleA Comprehension Aid
philipschwarz
PRO
0
410
Jetpack Composeとデザインシステム
rmakiyama
0
230
TCAとKMPを用いた新規動画配信アプリ 「ABEMA Live」の設計
tomu28
2
140
Adding Security to Microcontroller Ruby
sylph01
1
160
TypeScriptのパフォーマンス改善
yajihum
14
5k
Native Federation: The Future of Micro Frontends in Angular
manfredsteyer
PRO
0
170
Namespace, What and Why
tagomoris
3
670
slog登場に伴うloggerの取り回し手法の見直し / kamakura.go #6
arthur1
0
120
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
423
63k
Learning to Love Humans: Emotional Interface Design
aarron
267
39k
GitHub's CSS Performance
jonrohan
1025
450k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
242
1.2M
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
34
6.1k
Code Reviewing Like a Champion
maltzj
515
39k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
14
8.4k
We Have a Design System, Now What?
morganepeng
43
6.8k
Optimizing for Happiness
mojombo
370
69k
A designer walks into a library…
pauljervisheath
201
23k
A Modern Web Designer's Workflow
chriscoyier
689
190k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Transcript
@xgouchet Compiler based Testing CodeMobile UK 2019 - Chester
@xgouchet About me… Xavier F. Gouchet Android developer since the
Cupcake years Lead Android Engineer at WorkWell @xgouchet on every social network you can think of… 2
@xgouchet Testing is Hard Let’s let the compiler do most
of the hard work for us 3
@xgouchet Kotlin / Swift ▧ Statically Typed ▧ Strong Typed
▧ Type Safe ▧ Type Inference 4
@xgouchet Basic use case — JSON { "id" : 481516,
"title" : "Lorem ipsum dolor sit amet…", "picture" : "https://cloudhost.com/5162342", "created": 1553631328 } 5
@xgouchet Basic use case — App Model data class Event(
val id: Int, val title: String, val picture: String, val created: Int } 6
@xgouchet Primitive Aversion Primitives are lightweight… but lack context 7
@xgouchet Use existing types ▧ Integrated in framework and libraries
▧ Zero additional work data class Event( … val created: Date } 8
@xgouchet Type Alias ▧ Give context ▧ Prevent invalid assignements
▧ Ease Maintenance typealias Id = Int data class Event( val id: Id, … } 9
@xgouchet Type Checking ▧ Limit Primitive Scope ▧ Validate data
data class Url(val value: String) { init { val parsedUrl = URL(value) } } data class Event( … val picture: Url } 10
@xgouchet Additional gains 11
@xgouchet Bonus ▧ Share common operations ▧ Force explicit types
▧ Simplify complex structure 12
@xgouchet @xgouchet Thanks! Any questions? 13 Presentation template by SlidesCarnival