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
83
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
18
Demystifying the Test Pyramid
xgouchet
1
240
Successfully Publishing a Tested, Upgradeable and Documented Open Source Library
xgouchet
0
49
Property Based Testing in Practice
xgouchet
0
43
Develop your CI tools
xgouchet
2
340
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
75
It's time to up your test game
xgouchet
1
100
Other Decks in Programming
See All in Programming
Code Reviews
bkuhlmann
4
890
Azure OpenAI Serviceのプロンプトエンジニアリング入門
tomokusaba
3
710
Node.js v22 で変わること
yosuke_furukawa
PRO
9
3.5k
Milestoner
bkuhlmann
1
410
AWS CDKコントリビュートTIPS / aws-cdk-contribution-tips
gotok365
2
200
try! Swift Tokyo 2024 参加報告 / try! Swift Tokyo 2024 Report
hironytic
0
210
コーンフレークから始める モデリング会話入門
ogurotakayuki
0
370
Hanami and htmx
bkuhlmann
0
210
Netty Chicago Java User Group 2024-04-17
sullis
0
180
⼤規模⾔語モデルの拡張(RAG)が 終わったかも知れない件について
nearme_tech
23
15k
MetricKitで予期せぬ終了を検知する話 / Detect unexpected termination with MetricKit
nekowen
1
190
Polars入門
daikikatsuragawa
1
100
Featured
See All Featured
Debugging Ruby Performance
tmm1
70
11k
How GitHub Uses GitHub to Build GitHub
holman
468
290k
Adopting Sorbet at Scale
ufuk
68
8.6k
WebSockets: Embracing the real-time Web
robhawkes
59
7k
It's Worth the Effort
3n
180
27k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
221
21k
Designing with Data
zakiwarfel
96
4.8k
Reflections from 52 weeks, 52 projects
jeffersonlam
345
19k
The Straight Up "How To Draw Better" Workshop
denniskardys
227
130k
Into the Great Unknown - MozCon
thekraken
10
990
GitHub's CSS Performance
jonrohan
1025
450k
In The Pink: A Labor of Love
frogandcode
138
21k
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