Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
48
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
52
Kotlin Coroutines (Hands-On)
jabeznzomo99
0
29
Introduction to Kotlin (Hands On)
jabeznzomo99
0
120
Android MVVM Architecture
jabeznzomo99
0
44
Kotlin Coroutines: Google IO Extended 2019 Nairobi
jabeznzomo99
0
25
Other Decks in Programming
See All in Programming
関数実行の裏側では何が起きているのか?
minop1205
1
650
社内オペレーション改善のためのTypeScript / TSKaigi Hokuriku 2025
dachi023
1
540
認証・認可の基本を学ぼう前編
kouyuume
0
180
ソフトウェア設計の課題・原則・実践技法
masuda220
PRO
26
22k
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
190
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
190
20 years of Symfony, what's next?
fabpot
2
320
dotfiles 式年遷宮 令和最新版
masawada
1
690
バックエンドエンジニアによる Amebaブログ K8s 基盤への CronJobの導入・運用経験
sunabig
0
140
目的で駆動する、AI時代のアーキテクチャ設計 / purpose-driven-architecture
minodriven
11
4k
Microservices Platforms: When Team Topologies Meets Microservices Patterns
cer
PRO
1
960
ローターアクトEクラブ アメリカンナイト:川端 柚菜 氏(Japan O.K. ローターアクトEクラブ 会長):2720 Japan O.K. ロータリーEクラブ2025年12月1日卓話
2720japanoke
0
710
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.2k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
The Invisible Side of Design
smashingmag
302
51k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
Agile that works and the tools we love
rasmusluckow
331
21k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
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