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
A Guide to Unit Testing Architecture Components
Search
Android Maestro
August 09, 2019
Programming
53
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
A Guide to Unit Testing Architecture Components
Android Maestro
August 09, 2019
More Decks by Android Maestro
See All by Android Maestro
Easy Backends for Android Developers with Ktor
jabeznzomo99
1
57
Kotlin Coroutines (Hands-On)
jabeznzomo99
0
35
Introduction to Kotlin (Hands On)
jabeznzomo99
0
130
Android MVVM Architecture
jabeznzomo99
0
54
Kotlin Coroutines: Google IO Extended 2019 Nairobi
jabeznzomo99
0
28
Other Decks in Programming
See All in Programming
言語を使う側から、作る側へ。 自作 Lisp で得た新たな気づき。
andpad
0
120
鹿野さんに聞く!『TypeScriptコードレシピ集』で磨く実践力
tonkotsuboy_com
4
1.1k
はてなアカウント基盤 State of the Union
cockscomb
1
1.3k
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
850
Apache Hive: そしてCloud Native Lakehouseへ
okumin
1
130
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
230
1B+ /day規模のログを管理する技術
broadleaf
0
140
【SRE NEXT 2026 Lunch Session】一人目専任SREの立ち上げを加速する ― AIと進めたオンボーディングで2分を0.04秒にした話
pkshadeck
PRO
0
2.7k
作るコストが小さくなった時代 幸せに働くために改めて考えたいこと 〜エンジニアとして価値を出し続けるために注視している二分野〜
yuppeeng
0
100
Laravelで学ぶ Webアプリケーションチューニング入門/web_application_tuning_101
hanhan1978
4
560
AI時代の仕事技芸論〜ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ(スクフェス仙台 2026バージョン)
kuranuki
0
640
トークンをケチるな、設計しろ:GitHub Copilotを賢く使うコンテキスト戦略
ochtum
0
320
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Paper Plane
katiecoart
PRO
2
52k
ラッコキーワード サービス紹介資料
rakko
1
3.9M
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
350
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
200
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
2
340
Abbi's Birthday
coloredviolet
3
8.7k
Making Projects Easy
brettharned
120
6.7k
Skip the Path - Find Your Career Trail
mkilby
1
170
Designing for humans not robots
tammielis
254
26k
Agile that works and the tools we love
rasmusluckow
331
22k
Transcript
A Guide to Unit Testing Architecture Components
HELLO! I am Jabez Magomere (Mc JB) Android Developer and
Student (CS) 2 https://github.com/JabezNzomo99 @mc_jayb
3 Why Test? Testing is a good software practice that
helps level-up a team’s and an individual’s productivity and efficiency.
4 Why Test? Prevent unforeseen bugs in an application by
testing for all extreme use cases.
5 Get notified of any changes that breaks code (CI/CD)
Why Test?
6 Why Test? To write beautiful and clean code.
7 TESTING MYTHS
8 TESTING SLOWS DOWN DEVELOPMENT
9 TESTING IS HARD
10 TEST CODE IS NOT PRODUCTION CODE
11 Factors to consider when writing tests • Scope •
Fidelity • Speed
12
13 Architecture Components • LiveData • Room • View Model
• Data binding • Life Cycle • Navigation
14
15 Unit Testing Room
16 Unit Testing Room Testing points Test the behaviour your
database query functions in the DAOs. Insert, Delete, Get. etc
17 Unit Testing Room Testing Tools Room.inMemoryDatabase Builder() AndroidX Test
Robolectric 4.0 Hamcrest/Assert J
18 Unit Testing LiveData
19 Unit Testing LiveData Testing Tools Room.inMemoryDatabaseBuilder() AndroidX Test Robolectric
4.0 MockK/Mockito Hamcrest/Assert J Junit4/Junit5
20 Unit Testing View Model
21 Additional Resources 1. https://developer.android.com/training/testing/set-up-proje ct 2. https://medium.com/@boonkeat/android-unit-testing-with-j unit5-d1b8f9c620b6?source=email-444c006a35b8-1565059 737888-digest.reader------0-58------------------8bc853b8_1882_45
2b_ac63_879f881bb444-1§ionName=top
THANKS! Any questions? 22