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
iOSアプリ単体テスト入門
Search
Yamada Ryo
May 11, 2018
Programming
1.7k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
iOSアプリ単体テスト入門
初めて単体テストを書いてみたその手法と感想について。
Yamada Ryo
May 11, 2018
More Decks by Yamada Ryo
See All by Yamada Ryo
Apple PayとPassword AutoFillの実装方法と困った話
yamadaryo11
0
1.3k
クラスメソッドでiOSアプリ 開発をする際に使われた技術の紹介
yamadaryo11
1
800
Other Decks in Programming
See All in Programming
Apple Intelligenceとオンデバイス時代の到来
yahir0
0
230
AmebaブログはKMPから卒業します
kmars0605
0
330
私なりのハーネスエンジニアリング ~独自の言語処理系の開発を通して~
seosoft
0
180
Spec-driven Development with AI
simas
PRO
0
2.3k
Performance Optimization With LLMs
xleitix
0
250
Python Lambdaにおけるテストしやすい設計とAI支援の活用 / Designing Testable Python Lambda Functions with AI
kitano_yuichi
1
300
React Native経験者が Flutterを30⽇間触って驚いたこと
3saito
0
160
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
3
1.4k
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
300
Optunaを作ったときにやりたかったこと、その後 (2026/10/16, Optuna Meetup #3)
iwiwi
4
1.5k
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
290
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
410
Featured
See All Featured
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
350
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.8k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Statistics for Hackers
jakevdp
799
230k
Ruling the World: When Life Gets Gamed
codingconduct
0
440
The Invisible Side of Design
smashingmag
301
52k
First, design no harm
axbom
PRO
2
1.4k
BBQ
matthewcrist
90
10k
Ethics towards AI in product and experience design
skipperchong
2
460
How GitHub (no longer) Works
holman
316
150k
The Cost Of JavaScript in 2023
addyosmani
56
10k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
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)Λಋೖͯ͠ςε τͰ͖ΔϓϩμΫτίʔυͷΈ͕ଘࡏ͢ΔΑ͏ʹ͍ͨ͠ʢཧ ʣ
͝ਗ਼ௌ ͋Γ͕ͱ͏͍͟͝·ͨ͠