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
iOSアプリ単体テスト入門
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Yamada Ryo
May 11, 2018
Programming
0
1.5k
iOSアプリ単体テスト入門
初めて単体テストを書いてみたその手法と感想について。
Yamada Ryo
May 11, 2018
Tweet
Share
More Decks by Yamada Ryo
See All by Yamada Ryo
Apple PayとPassword AutoFillの実装方法と困った話
yamadaryo11
0
1.2k
クラスメソッドでiOSアプリ 開発をする際に使われた技術の紹介
yamadaryo11
1
720
Other Decks in Programming
See All in Programming
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
180
Apache Iceberg V3 and migration to V3
tomtanaka
0
170
AtCoder Conference 2025
shindannin
0
1.1k
Gemini for developers
meteatamel
0
100
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
480
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
310
Best-Practices-for-Cortex-Analyst-and-AI-Agent
ryotaroikeda
1
110
ノイジーネイバー問題を解決する 公平なキューイング
occhi
0
110
「ブロックテーマでは再現できない」は本当か?
inc2734
0
1k
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
250
AgentCoreとHuman in the Loop
har1101
5
240
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.2k
30 Presentation Tips
portentint
PRO
1
220
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Technical Leadership for Architectural Decision Making
baasie
2
250
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
Documentation Writing (for coders)
carmenintech
77
5.3k
Building an army of robots
kneath
306
46k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
110
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
230
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.1k
Transcript
IOSΞϓϦ୯ମςετ ೖ ΫϥεϝιουגࣜձࣾɹϞόΠϧΞϓϦαʔϏε෦ɿɹࢁాɹྑ
ରऀ • ະͩiOSΞϓϦͰ୯ମςετΛॻ͍ͨ͜ͱͷͳ͍ਓ • ςετ͍͢͠ίʔυͷॻ͖ํ͕ྑ͘Θ͔Βͳ͍ਓ
ςʔϚΛܾΊͨܦҢ • ࢲ͕ࣗiOSΞϓϦͷ୯ମςετΛॻ͍ͨܦݧ͕ͳ͍ • ϓϩδΣΫτͰ୯ମςετΛॻ͘ػձ͕͋ͬͨ • ͜Ε͔Β୯ମςετͷཧղΛਂΊ͍͖͍ͯͨͱ͍͏Ϟν ϕʔγϣϯ
؆୯ͳࣗݾհ • iOSΞϓϦ։ൃܦݧɿ̎ • αʔόαΠυWebFrontɺΈࠐΈwindowsͷΫϥαό ͳͲ৭ʑͳҊ݅ʹབྷΜͰ͍ͨͷͰͣͬͱiOSΞϓϦ։ൃΛ ͍ͯͨ͠༁Ͱͳ͍Ͱ͢ • ݩCOBOLer
ମݧͨ͠୯ମςετͷޮՌ • ͙͢ʹޮՌΛ࣮ײͰ͖ΔͷͰͳ͍ɻ • ޙʑɺʮطଘͷϓϩμΫτίʔυΛഁյ͍ͯ͠ͳ͍͔͕Θ ͔Δʯ • ഁյ͍ͯ͠ͳ͍͜ͱ͕Θ͔ΔͨΊɺਫ਼ਆతʹ҆৺ײ͕͋Δ
ࠓճͷ୯ମςετಋೖͷൣғ • ϏδωεϩδοΫʹద༻ • UIςετʹ͍ͭͯࠓޙͷ՝ͱ͍ͯ͠Δ
ςετΛॻ͜͏ͱͯ͠ͿͪͨΔน • ΊͪΌͪ͘Όςετ͠ʹ͍͘෦͕ग़ͯ͘Δɻ • ఘΊ؊৺
ͦͦςετ͍͢͠ίʔυͱʁ • Dependency Injection(DI)͠·͢ • ґଘ͢ΔϞδϡʔϧΛ෦Ͱੜ͢ΔͷͰͳ͘ɺʮೖ ͢Δʯ
SWIFTͰDIͬͯͲ͏Δͷʁ • protocolΛ্खʹ͏ • ࣗͰॻ͍ͨΫϥεͰ͋ΕɺinitializeͰґଘؔΛೖ ͢Δ • ViewControllerʹDIͰ͖ΔϥΠϒϥϦଘࡏ͢Δ • ViewControllerผ్InjectϝιουΛ࡞ͬͯରԠͨ͠
۩ମతͳྫ.ʢϓϩμΫτʣ ViewController Presenter DataStore Viewͷૢ࡞ APIίʔϧ Viewͷඳը໋ྩ APIίʔϧ໋ྩ • ࠨͷΑ͏ͳߏ
ͷϓϩμΫτΛྫ ʹ͠·͢ɻ • ࠓճPresenter ʹߜͬͯղઆ͠· ͢
۩ମతͳྫ.ʢVIEWCONTROLLERʣ
۩ମతͳྫ.ʢDIʣ
۩ମతͳྫ.ʢPRESENTER - 1ʣ
۩ମతͳྫ.ʢPRESENTER - 2ʣ
۩ମతͳྫ.ʢMOCKʣ
None
None
None
୯ମςετ͍͢͠ϞόΠϧΞʔΩςΫνϟ • ΫϦϯΞʔΩςΫνϟ
ʮςετ͍͢͠ίʔυʯΛແࢹࣦͯ͠ഊͨ͠ྫ • KeychainΛૢ࡞͢ΔγϯάϧτϯΛ༻ͨ͠SDKΛ PresenterͰૢ࡞ͯ͠KeychainͷΛॻ͖͑ͯ͠ ·ͬͨ
SDK͕γϯάϧτϯΦϒδΣΫτΛ͍ͬͯͨ࣌ͷճආ ํ๏ • WrapperΫϥεΛ࡞ͬͯɺprotocolΛܧঝͨ͠Ϋϥεʹแ Μͩ
୯ମςετΛಋೖͨ͠ࡍͷฐ • ࣮ྔʢ࡞ۀྔʣଟ͘ͳΔ • ΠϯλʔϑΣʔε͕มΘΔ༷มߋͷࡍɺमਖ਼ྔ͕ଟ͘ͳͬ ͯਫ਼ਆతʹͭΒ͍
൪֎ฤɿ࣮APIΛୟ͘ςετΛॻ͖͔ͨͬͨ • ຖճࢼ͍ͨ͠Θ͚Ͱͳ͍͕ɺAPIʢ֎෦γεςϜʣ͕ਖ਼ ͍͠ϨεϙϯεΛฦ͍ͯ͠Δ͔ɺ࣌ʑ֬ೝ͔ͨͬͨ͠ • SchemeΛ͚ͯɺ࣮APIΛୟ͘ςετΛผ్࡞ͨ͠ • CIπʔϧʹͯ୯ମςετΛΒ͍͕ͤͯͨɺ࣮APIΛୟ͘ Schemeର֎ͱͨ͠
ݱঢ়ͷײ • Կ͔ഁյతมߋΛ͛ͨ໘͕͋ΓɺޮՌ͋ͬͨ • ॻ͖׳Ε͍ͯͳ͍ɺ࡞ۀ͕ͳ͔ͳ͔ਐ·ͳ͔ͬͨ • Ώ͘Ώ͘Test-DrivenDevelopment(TDD)Λಋೖͯ͠ςε τͰ͖ΔϓϩμΫτίʔυͷΈ͕ଘࡏ͢ΔΑ͏ʹ͍ͨ͠ʢཧ ʣ
͝ਗ਼ௌ ͋Γ͕ͱ͏͍͟͝·ͨ͠