Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
90
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
65
Unleash your Programming Creativity
xgouchet
0
100
Demystifying the Test Pyramid
xgouchet
1
360
Successfully Publishing a Tested, Upgradeable and Documented Open Source Library
xgouchet
0
60
Property Based Testing in Practice
xgouchet
0
54
Develop your CI tools
xgouchet
2
360
How to write a safe and reliable Open Source Library
xgouchet
1
230
Benchmarking your app's performance
xgouchet
0
180
Benchmarking your app's performance
xgouchet
0
84
Other Decks in Programming
See All in Programming
今からはじめるAndroidアプリ開発 2024 / DevFest 2024
star_zero
0
770
cmp.Or に感動した
otakakot
3
340
[JAWS-UG横浜 #76] イケてるアップデートを宇宙いち早く紹介するよ!
maroon1st
0
350
romajip: 日本の住所CSVデータを活用した英語住所変換ライブラリを作った話
sangunkang
0
2.4k
useSyncExternalStoreを使いまくる
ssssota
2
350
Djangoの開発環境で工夫したこと - pre-commit / DevContainer
hiroki_yod
1
650
イマのCSSでできる インタラクション最前線 + CSS最新情報
clockmaker
5
3.8k
Develop iOS apps with Neovim / vimconf_2024
uhooi
1
320
クリエイティブコーディングとRuby学習 / Creative Coding and Learning Ruby
chobishiba
0
3.7k
あれやってみてー駆動から成長を加速させる / areyattemite-driven
nashiusagi
1
160
macOS なしで iOS アプリを開発する(※ただし xxx に限る)
mitsuharu
1
170
プロダクトの品質に コミットする / Commit to Product Quality
pekepek
1
690
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
A Philosophy of Restraint
colly
203
16k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
110
49k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
0
27
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
The Pragmatic Product Professional
lauravandoore
32
6.3k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
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