Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
A Guide to Unit Testing Architecture Components
Search
Android Maestro
August 09, 2019
Programming
58
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
61
Kotlin Coroutines (Hands-On)
jabeznzomo99
0
50
Introduction to Kotlin (Hands On)
jabeznzomo99
0
140
Android MVVM Architecture
jabeznzomo99
0
63
Kotlin Coroutines: Google IO Extended 2019 Nairobi
jabeznzomo99
0
37
Other Decks in Programming
See All in Programming
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
820
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
150
PyConTW 2026 - AI Coding 不只是工具升級, 區域醫院醫療資訊系統協作開發與資訊團隊轉型實踐
cclai999
0
150
Web Framework Benchmark Battle 2026, Any%
a_matsuda
2
2.8k
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
28
34k
ChromeでローカルLLM
ryu1013
0
160
npm との違いを手がかりにGo の依存管理を理解したい
optim
0
1k
[2026-10-09]一枚の布で作らなくてもいい。 信頼性は「パッチワーク」で紡がれる~既存の運用と新しい可能性をつなぎ合わせてきたCREの話~
tosite
0
110
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.7k
エージェントを使い続けるためのメタワーク / Meta-work for keeping using the agent
rkaga
6
1.7k
sbt 2.0: takeoff
eed3si9n
0
170
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
190
Featured
See All Featured
The Spectacular Lies of Maps
axbom
PRO
1
1.1k
Heart Work Chapter 1 - Part 1
lfama
PRO
10
37k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
500
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
We Are The Robots
honzajavorek
0
400
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
410
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
720
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
640
Typedesign – Prime Four
hannesfritz
42
3.2k
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