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
790
Other Decks in Programming
See All in Programming
sbt 2.0: takeoff
eed3si9n
0
160
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
220
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
270
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
260
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
0
1.5k
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
5.1k
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
0
510
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
2
660
phperだってパンチカードでコーディングしたい
o0h
PRO
0
340
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
5
3.8k
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
640
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
790
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
570
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
A Soul's Torment
seathinner
8
3.8k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Designing for Timeless Needs
cassininazir
1
530
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
WCS-LA-2024
lcolladotor
0
890
エンジニアに許された特別な時間の終わり
watany
109
250k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
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)Λಋೖͯ͠ςε τͰ͖ΔϓϩμΫτίʔυͷΈ͕ଘࡏ͢ΔΑ͏ʹ͍ͨ͠ʢཧ ʣ
͝ਗ਼ௌ ͋Γ͕ͱ͏͍͟͝·ͨ͠