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
哲学史とモデリング
tanakahisateru
2
430
GitLab CI/CD で C#/WPFアプリケーションのテストとインストーラーのビルド・デプロイを自動化する
hacarus
0
620
Balkan Ruby 2024 — How and why to run SQLite on Rails in production
fractaledmind
0
110
欠陥を早期に発見するための Software Engineer in Test とその重要性 / What is Software Engineer in Test and How they works
orgachem
PRO
18
2.4k
RustでAWS Lambda functionをいい感じに書く
taiki45
2
150
RubyGems on ruby.wasm
kateinoigakukun
0
130
Exploring the Implementation of “t.Run”, “t.Parallel”, and “t.Cleanup”
akarin
1
160
TypeScript Custom GitHub Action Development Tips
peaceiris
5
760
Deep Dive into React Stream/Serialize
mugi_uno
4
870
Powerfully Typed TypeScript
euxn23
4
1.7k
Runtime Objects in Rust
mitsuhiko
0
220
TypeScriptから始める VR生活
tamagokakeg
2
120
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
133
6.3k
Ruby is Unlike a Banana
tanoku
96
10k
Rails Girls Zürich Keynote
gr2m
91
13k
Designing on Purpose - Digital PM Summit 2013
jponch
111
6.5k
Code Review Best Practice
trishagee
56
15k
Designing Experiences People Love
moore
136
23k
Building a Modern Day E-commerce SEO Strategy
aleyda
22
6.5k
Adopting Sorbet at Scale
ufuk
69
8.6k
Designing with Data
zakiwarfel
96
4.8k
Debugging Ruby Performance
tmm1
70
11k
StorybookのUI Testing Handbookを読んだ
zakiyama
13
4.7k
Producing Creativity
orderedlist
PRO
338
39k
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