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
Libérez votre créativité
xgouchet
0
51
Unleash your Programming Creativity
xgouchet
0
73
Demystifying the Test Pyramid
xgouchet
1
280
Successfully Publishing a Tested, Upgradeable and Documented Open Source Library
xgouchet
0
51
Property Based Testing in Practice
xgouchet
0
47
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
170
Benchmarking your app's performance
xgouchet
0
77
Other Decks in Programming
See All in Programming
CSC307 Lecture 05
javiergs
PRO
0
210
Introduction to GitOps
hwchiu
0
110
Findy - エンジニア向け会社紹介 / Findy Letter for Engineers
findyinc
2
81k
Trial
cairolibrary720
1
130
Folding Cheat Sheet #7
philipschwarz
PRO
0
150
The rollercoaster of releasing an Android, iOS, and macOS app with Kotlin Multiplatform | droidcon Berlin
prof18
0
110
Javaの現状2024夏 / Java current status 2024 summer
kishida
4
1.4k
CSC307 Lecture 08
javiergs
PRO
0
330
Architectures with Lightweight Stores: New Rules and Options
manfredsteyer
PRO
0
100
英語
s_shimotori
1
220
Rustのweb開発を助ける 便利なツール紹介
yuki0418
1
190
Namespace on read
tagomoris
2
370
Featured
See All Featured
Designing for humans not robots
tammielis
247
25k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
44
4.7k
How to name files
jennybc
67
96k
GitHub's CSS Performance
jonrohan
1026
450k
Building Flexible Design Systems
yeseniaperezcruz
323
37k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
277
13k
The Cult of Friendly URLs
andyhume
75
5.9k
A Philosophy of Restraint
colly
200
16k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
12
3.8k
Scaling GitHub
holman
458
140k
4 Signs Your Business is Dying
shpigford
178
21k
Building a Modern Day E-commerce SEO Strategy
aleyda
25
6.7k
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