Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Compiler Based Testing
Xavier Gouchet
April 03, 2019
Programming
1
56
Compiler Based Testing
Xavier Gouchet
April 03, 2019
Tweet
Share
More Decks by Xavier Gouchet
See All by Xavier Gouchet
Successfully Publishing a Tested, Upgradeable and Documented Open Source Library
xgouchet
0
29
Property Based Testing in Practice
xgouchet
0
29
Develop your CI tools
xgouchet
2
260
How to write a safe and reliable Open Source Library
xgouchet
1
160
Benchmarking your app's performance
xgouchet
0
68
Benchmarking your app's performance
xgouchet
0
50
It's time to up your test game
xgouchet
1
96
Benchmarking your application’s performance
xgouchet
0
140
Rock The Gradle MobileEra
xgouchet
2
200
Other Decks in Programming
See All in Programming
社会人 20 年目エンジニア、発信で技術学びなおしてる話
e99h2121
1
140
Milestoner
bkuhlmann
1
240
Prácticas de Seguridad en Kubernetes
pablokbs
0
120
OSSから学んだPR Descriptionの書き方
fugakkbn
4
130
%q is for Quine
koic
0
400
Refactor with using `available` and `deprecated`
417_72ki
3
380
Findy - エンジニア向け会社紹介 / Findy Letter for Engineers
findyinc
2
42k
Showkase、Paparazziを用いたビジュアルリグレッションテストの導入にチャレンジした話 / MoT TechTalk #15
mot_techtalk
0
100
Functional Data Engineering - A Blueprint for adopting functional principles in data pipeline
vananth22
0
170
Step Functions Distributed Map を使ってみた
codemountains
0
100
[2023년 1월 세미나] 데이터 분석가 되면 어떤 일을 하나요?
datarian
0
560
Amazon QuickSightのアップデート -re:Invent 2022の復習&2022年ハイライト-
shogo452
0
210
Featured
See All Featured
Ruby is Unlike a Banana
tanoku
93
9.5k
Designing for humans not robots
tammielis
245
24k
Rebuilding a faster, lazier Slack
samanthasiow
69
7.5k
Embracing the Ebb and Flow
colly
75
3.6k
Practical Orchestrator
shlominoach
178
8.9k
The Illustrated Children's Guide to Kubernetes
chrisshort
22
42k
Debugging Ruby Performance
tmm1
67
11k
For a Future-Friendly Web
brad_frost
166
7.7k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
6
840
Put a Button on it: Removing Barriers to Going Fast.
kastner
56
2.5k
Building a Scalable Design System with Sketch
lauravandoore
451
31k
VelocityConf: Rendering Performance Case Studies
addyosmani
317
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