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
Let's write RxTesting Code
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Byeong Chan - Lee
November 12, 2019
Programming
0
41
Let's write RxTesting Code
RxTest와 RxBlocking을 사용하여 MVVM + RxSwift 아키텍처를 가진 앱의 테스트 코드를 작성해봅시다.
Byeong Chan - Lee
November 12, 2019
Tweet
Share
More Decks by Byeong Chan - Lee
See All by Byeong Chan - Lee
회사한테 플러팅하기
woollim
0
22
스페셜리스트, 제너럴리스트 (모든 것이 변하는 개발시장에서 살아남는 법)
woollim
0
130
[Review] Floor noise project in Sullivan
woollim
0
100
[No4] Floor noise project in Sullivan
woollim
0
170
[No1] Floor noise project in Sullivan
woollim
0
65
Other Decks in Programming
See All in Programming
dchart: charts from deck markup
ajstarks
3
990
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
190
CSC307 Lecture 07
javiergs
PRO
0
550
QAフローを最適化し、品質水準を満たしながらリリースまでの期間を最短化する #RSGT2026
shibayu36
2
4.3k
Grafana:建立系統全知視角的捷徑
blueswen
0
330
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
990
Data-Centric Kaggle
isax1015
2
760
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
450
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
540
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
690
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
970
フルサイクルエンジニアリングをAI Agentで全自動化したい 〜構想と現在地〜
kamina_zzz
0
400
Featured
See All Featured
Side Projects
sachag
455
43k
How to Ace a Technical Interview
jacobian
281
24k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.9k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.3k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.3k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
1
49
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
120
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
220
WCS-LA-2024
lcolladotor
0
450
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Statistics for Hackers
jakevdp
799
230k
Transcript
ߛ࢟۞٘ ߽ଲ 3Y5FTUэदೞӝ 3Y5FTU 3Y#MPDLJOHਸэঌইࠁӝ
ߛ࢟۞٘ ߽ଲ 3Y5FTUэदೞӝ 3Y5FTU 3Y#MPDLJOHਸэঌইࠁӝ
1. TestCode, ObservableTestCodeۆ? 2. RxBlockingী ೧ 3. RxTestী ೧ 4.
RxSwiftܳ పझ೧ࠁ! ݾର
1. TestCodeۆ?
যڃ زਸ ࣻ೯ ೮ਸ ٸ 1) ਗೞח ч աয়ח Ѩૐ
2) োࣘغযঠ ೞח ز ࣻ೯غח Ѩૐ 5FTU$PEFۆ
ਗೞחчաয়ח
ਗೞחчաয়ח
ਗೞחчաয়ח
ਗೞחчաয়ח ч ਗೞח ഋక۽ աয়ח Ѩૐ
োࣘغযঠೞחزਸࣻ೯ೞח
োࣘغযঠೞחزਸࣻ೯ೞח
োࣘغযঠೞחزਸࣻ೯ೞח
োࣘغযঠೞחزਸࣻ೯ೞח
োࣘغযঠೞחزਸࣻ೯ೞח োࣘغযঠ ೞח ز ࣻ೯ Ѩૐ
Ӓۢ Observable?
None
RxTest ࢜ղӝ "ߛ࢟"
None
None
None
Eventܳ زӝਵ۽ ߉ਸ ࣻח হਸө? subscribeহ Eventܳ ߉ਸ ࣻח হਸө?
Hot Observableੌ ٸח? reduceب ޅೞחؘ…
ӝೞח ఋ߁ী Eventо աয়ח Ѩૐ? ߡౡ ׂۥਸ ٸ Eventо աয়ח
Ѩૐ೧ঠ ೞਗ਼ই?
None
/* Eventܳ рױೞѱ ୶ೡ ࣻ যঠ ೣ /* ਗೞח ч
ਗೞח ఋ߁ী աয়ח Ѩૐ
RxBlocking RxTest যࢲ৬, పझח ?
2. RxBlocking
None
➜ [ , , , , ]
None
None
None
onCompleteо ڄয ٸө ӝܽ…
None
➜ [ , , , , ] onCompleteо ԙ ڄযઉঠ
ೣ
.toBlocking(timeout: RxTimeInterval?)
[ , , ] ➜
- ColdObservable Eventܳ Ѩૐೡ ٸ ࢎਊ - ౠ दрزউ ߑػ
Observable Eventب Ѩૐ оמ • HotObservableب ࢎਊ оמ 3Y#MPDLJOH
3. RxTest
1ୡ 2ୡ 3ୡ 4ୡ 5ୡ ➜ [ (, 1ୡ), (,
2ୡ), (, 3ୡ), (, 4ୡ), (, 5ୡ) ] ➜ 3ୡী о ա৳חо?
None
None
None
let buttonTapped = s.createHotObservable([ .next(1, Void()), .next(3, Void()) ])
ҳة ৈࠗ৬ ࢚ҙহ ߮ ߊࢤ
ҳة दغݶ ೧ ࣽࢲ۽ ߮ ߊࢤ
1ୡ 2ୡ 3ୡ 4ୡ 5ୡ ҙ ➜ ➜ [ (,
1ୡ), (, 2ୡ), (, 3ୡ), (, 4ୡ), (, 5ୡ) ]
о࢚ दр ݽف ܳ ٸө ҙ
о࢚ दр ݽف ܳ ٸө ҙ Observable ա ঋইب ࢚ҙX
о࢚ दр ݽف ܳ ٸө ҙ Hot Observableب పझ оמ!
None
None
None
о࢚ दр ݽف ܳٸө..
None
- Observableী दрѐ֛ਸ ֍যષ • ܳ ా೧ ઁ ޖ ա৳ח
Ѩૐ оמ - Observerܳ ా೧ Hot, Cold ݽف Ѩૐоמ • о࢚ दр ܳ ٸө ҙ റ ఋ߁җ Event ߈ജ 3Y5FTUח
4. RxSwiftܳ పझೞ
None
- ਗೞח ч ࢚ਵ۽ աয়ח Ѩૐ - Responseী ࢚ҙহ ࢚ೞח
Ѿҗо աয়ח JT-PBEJOH5FTU$BTF
None
None
None
None
None
None
None
✨
None
- tapped غਸ ٸ ݃ ਗೞח ч ࢚ਵ۽ աয়ח Ѩૐ
- Responseী ࢚ҙহ ࢚ೞח Ѿҗо աয়ח MPBEJOH5FTU$BTF
None
None
None
None
None
None
None
None
None
✨ ✨ ✨
- Mocking, о࢚ दр, Observer.. ઁ ߓա? - TestCodeࠁ ӝמ
ѐߊ ؊ ࢶ ইפঠ? 3Y#MPDLJOH 3Y5FTU
func removeAllData() { /* ҳഅ */ Implements() }
func removeAllData() { /* ҳഅ */ Implements() } ݅ড ઁীࢲ
־ۅػ ؘఠо ݶ?
োೞѱ زೡ Ѫ э ٘ ߓन ➜ Hotfix
TestCodeח োೠ ٘о োೞѱ زೞח Ѩૐ
RxSwift TestCodeח Observable োೞѱ ߑغח Ѩૐ
“RxSwift & పझ٘৬ ೣԋ Әਲ਼ ഄनਸ ٜ݅যт ࢎٜਸ ߛ࢟ ӝ݀פ.”
- RxTest, RxBlocking • https://www.raywenderlich.com/7408-testing-your-rxswift-code • https://github.com/ReactiveX/RxSwift/blob/master/Documentation/UnitTests.md - Nimble •
https://github.com/Quick/Nimble - Stubber • https://github.com/devxoul/Stubber ଵҊܐ
slido.com / #P445
None