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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Android Maestro
August 09, 2019
Programming
54
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
58
Kotlin Coroutines (Hands-On)
jabeznzomo99
0
41
Introduction to Kotlin (Hands On)
jabeznzomo99
0
140
Android MVVM Architecture
jabeznzomo99
0
61
Kotlin Coroutines: Google IO Extended 2019 Nairobi
jabeznzomo99
0
32
Other Decks in Programming
See All in Programming
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
360
速習iPhone Duo対応
yuukiw00w
2
910
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
170
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
5.2k
アクセシビリティから考える情報設計
high_g_engineer
0
430
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
8
5.2k
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
170
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
330
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
320
すこし踏み込む CancellationToken
htkym
2
1.5k
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.6k
mrbgem 三角測量 開発
ogom
0
140
Featured
See All Featured
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.5k
Darren the Foodie - Storyboard
khoart
PRO
4
4k
GraphQLとの向き合い方2022年版
quramy
50
15k
So, you think you're a good person
axbom
PRO
2
2.2k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
550
Designing Powerful Visuals for Engaging Learning
tmiket
1
580
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1k
Practical Orchestrator
shlominoach
192
12k
GitHub's CSS Performance
jonrohan
1033
470k
Docker and Python
trallard
47
4.2k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.1k
Heart Work Chapter 1 - Part 1
lfama
PRO
10
36k
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