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
0
49
A Guide to Unit Testing Architecture Components
Android Maestro
August 09, 2019
Tweet
Share
More Decks by Android Maestro
See All by Android Maestro
Easy Backends for Android Developers with Ktor
jabeznzomo99
1
54
Kotlin Coroutines (Hands-On)
jabeznzomo99
0
32
Introduction to Kotlin (Hands On)
jabeznzomo99
0
120
Android MVVM Architecture
jabeznzomo99
0
45
Kotlin Coroutines: Google IO Extended 2019 Nairobi
jabeznzomo99
0
27
Other Decks in Programming
See All in Programming
守る「だけ」の優しいEMを抜けて、 事業とチームを両方見る視点を身につけた話
maroon8021
3
1.4k
見せてもらおうか、 OpenSearchの性能とやらを!
shunta27
1
140
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
4
1.4k
Cyrius ーLinux非依存にコンテナをネイティブ実行する専用OSー
n4mlz
0
250
Rethinking API Platform Filters
vinceamstoutz
0
910
CS教育のDX AIによる育成の効率化
niftycorp
PRO
0
170
RailsのValidatesをSwift Macrosで再現してみた
hokuron
0
130
Strategy for Finding a Problem for OSS: With Real Examples
kibitan
0
110
Migration to Signals, Signal Forms, Resource API, and NgRx Signal Store @Angular Days 03/2026 Munich
manfredsteyer
PRO
0
160
Codex CLIのSubagentsによる並列API実装 / Parallel API Implementation with Codex CLI Subagents
takatty
2
500
Windows on Ryzen and I
seosoft
0
400
Java 21/25 Virtual Threads 소개
debop
0
280
Featured
See All Featured
The SEO identity crisis: Don't let AI make you average
varn
0
420
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
850
The Cost Of JavaScript in 2023
addyosmani
55
9.8k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
We Have a Design System, Now What?
morganepeng
55
8k
sira's awesome portfolio website redesign presentation
elsirapls
0
200
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
KATA
mclloyd
PRO
35
15k
Music & Morning Musume
bryan
47
7.1k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
68
38k
How to train your dragon (web standard)
notwaldorf
97
6.6k
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