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
46
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
Findy - エンジニア向け会社紹介 / Findy Letter for Engineers
findyinc
2
74k
株式会社ゼネテック
genetec
0
130
Powerfully Typed TypeScript
euxn23
4
1.7k
WebGLで始める コンピュータグラフィックス入門
heller77
0
390
チーム立ち上げにAWSを活用したらClaudeさんに褒められた話
mkdev10
3
230
Embedding it into Ruby code
soutaro
2
400
GNU Makeの使い方 / How to use GNU Make
kaityo256
PRO
13
4.4k
哲学史とモデリング
tanakahisateru
2
430
Dev ContainersとTestcontainers
bells17
3
100
HonoのRPCで真の型安全が欲しかった
kosei28
1
160
How to improve maintainability and readability of your automated tests? ( #scrumniigata )
teyamagu
PRO
1
130
Long journey of Ruby standard library RubyKaigi 2024
andpad
2
270
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
356
18k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
20
1.8k
What the flash - Photography Introduction
edds
64
11k
Why Our Code Smells
bkeepers
PRO
331
56k
RailsConf 2023
tenderlove
9
590
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
41
4.5k
Building a Scalable Design System with Sketch
lauravandoore
457
32k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
12
1.1k
Why You Should Never Use an ORM
jnunemaker
PRO
51
8.7k
Mobile First: as difficult as doing things right
swwweet
217
8.6k
BBQ
matthewcrist
80
8.8k
10 Git Anti Patterns You Should be Aware of
lemiorhan
649
58k
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