Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Let's write RxTesting Code
Search
Byeong Chan - Lee
November 12, 2019
Programming
0
40
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
18
스페셜리스트, 제너럴리스트 (모든 것이 변하는 개발시장에서 살아남는 법)
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
64
Other Decks in Programming
See All in Programming
DevFest Android in Korea 2025 - 개발자 커뮤니티를 통해 얻는 가치
wisemuji
0
140
tparseでgo testの出力を見やすくする
utgwkk
2
220
S3 VectorsとStrands Agentsを利用したAgentic RAGシステムの構築
tosuri13
6
310
手が足りない!兼業データエンジニアに必要だったアーキテクチャと立ち回り
zinkosuke
0
690
AIコーディングエージェント(skywork)
kondai24
0
170
著者と進める!『AIと個人開発したくなったらまずCursorで要件定義だ!』
yasunacoffee
0
140
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
390
LLM Çağında Backend Olmak: 10 Milyon Prompt'u Milisaniyede Sorgulamak
selcukusta
0
120
안드로이드 9년차 개발자, 프론트엔드 주니어로 커리어 리셋하기
maryang
1
110
大体よく分かるscala.collection.immutable.HashMap ~ Compressed Hash-Array Mapped Prefix-tree (CHAMP) ~
matsu_chara
2
220
Cap'n Webについて
yusukebe
0
130
マスタデータ問題、マイクロサービスでどう解くか
kts
0
100
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Done Done
chrislema
186
16k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.3k
Side Projects
sachag
455
43k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.2k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.2k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Embracing the Ebb and Flow
colly
88
4.9k
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