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
51
0
Share
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
56
Kotlin Coroutines (Hands-On)
jabeznzomo99
0
33
Introduction to Kotlin (Hands On)
jabeznzomo99
0
130
Android MVVM Architecture
jabeznzomo99
0
48
Kotlin Coroutines: Google IO Extended 2019 Nairobi
jabeznzomo99
0
28
Other Decks in Programming
See All in Programming
Agent Skills を社内で育てる仕組み作り
jackchuka
1
2k
SkillsをS3 Filesに置く時のあれこれ
watany
3
1.6k
なぜあなたのコードには「コシ」がないのか?〜AI時代に問う、最後まで美味しい設計と戦略〜 #phpconkagawa / phpconkagawa2026
shogogg
0
210
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
470
エラー処理の温故知新 / history of error handling technic
ryotanakaya
7
1.9k
PicoRuby for IoT: Connecting to the Cloud with MQTT
yuuu
2
770
Surviving Black Friday: 329 billion requests with Falcon!
ioquatix
0
3.2k
Structured Concurrency, Scoped Values and Joiners in the JDK 25 26 27
josepaumard
1
150
RailsTokyo 2026#4: AI様があれば、 Hotwireの弱点は消えるか?
naofumi
2
330
WebAssembly を読み込むベストプラクティス 2026年春版 / Best Practices for Loading WebAssembly (Spring 2026)
petamoriken
5
1.1k
Terraform言語の静的解析 / static analysis of Terraform language
wata727
1
150
[BalkanRuby 2026] Drop your app/services!
palkan
0
120
Featured
See All Featured
Skip the Path - Find Your Career Trail
mkilby
1
120
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
230
Statistics for Hackers
jakevdp
799
230k
Into the Great Unknown - MozCon
thekraken
41
2.5k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
550
A Modern Web Designer's Workflow
chriscoyier
698
190k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.2k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
150
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.5k
The SEO Collaboration Effect
kristinabergwall1
1
450
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