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
アプリのユニットテストについて初歩から考えてみる/ABC UnitTest
Search
Koichiro Oishi
October 03, 2017
Programming
3
800
アプリのユニットテストについて初歩から考えてみる/ABC UnitTest
2017/10/02 俺コン Vol.1 / Day.1
Koichiro Oishi
October 03, 2017
Tweet
Share
More Decks by Koichiro Oishi
See All by Koichiro Oishi
Kotlin/Swift 有理数クラスのすすめ
koishi
0
1.2k
iOSアプリ開発者から見たKotlin
koishi
2
690
5分でわかるPassword_Autofill_for_Apps
koishi
0
1k
Other Decks in Programming
See All in Programming
As an Engineers, let's build the CRM system via LINE Official Account 2.0
clonn
1
670
Discord Bot with AI -for English learners-
xin9le
1
120
Webエンジニア主体のモバイルチームの 生産性を高く保つためにやったこと
igreenwood
0
330
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
620
これが俺の”自分戦略” プロセスを楽しんでいこう! - Developers CAREER Boost 2024
niftycorp
PRO
0
190
Go の GC の不得意な部分を克服したい
taiyow
2
760
数十万行のプロジェクトを Scala 2から3に完全移行した
xuwei_k
0
260
rails statsで大解剖 🔍 “B/43流” のRailsの育て方を歴史とともに振り返ります
shoheimitani
2
930
layerx_20241129.pdf
kyoheig3
2
290
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
1
350
.NET 9アプリをCGIとして レンタルサーバーで動かす
mayuki
1
770
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
290
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1366
200k
Designing for humans not robots
tammielis
250
25k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Fireside Chat
paigeccino
34
3.1k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Music & Morning Musume
bryan
46
6.2k
Thoughts on Productivity
jonyablonski
67
4.4k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.3k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
0
94
4 Signs Your Business is Dying
shpigford
181
21k
Transcript
ΞϓϦͷϢχοτςετʹͭ ͍ͯॳา͔Βߟ͑ͯΈΔ 2017/10/02 Զίϯ Vol.1 / Day.1 େੴ ߂Ұɹ(@mego_, Koishi)
1 Koichiro Oishi, 2017/10/02
ࣗݾհ • େੴ ߂Ұ • iOSΞϓϦΤϯδχΞ • גࣜձࣾϚφϘ →9݄ʹSIer͔Βస৬͠·͠ ͨʂ
2 Koichiro Oishi, 2017/10/02
ຊͷ͓ • ΞϓϦͷϢχοτςετΛͳΜͱͳ͘ॻ͍ͯΔ • Xcodeඪ४ͷXCTestΛ༻ • ओʹϞσϧ෦ͷΈ • ௨৴ॲཧ։ൃαʔόͱ௨৴͢Δςετ •
UIςετϊʔλον 3 Koichiro Oishi, 2017/10/02
4 Koichiro Oishi, 2017/10/02
৭ʑؾʹͳΔ͜ͱ͋ͬͯɺ ৄ͍͠ਓʹฉ͍ͯΈ͍ͨ 5 Koichiro Oishi, 2017/10/02
ͱ͍͏͜ͱͰɺςετʹৄ͠ ͍ਓʹฉ͍ͯߟ͑ͯΈ·ͨ͠ (લ৬ͷݱͰͷ) 6 Koichiro Oishi, 2017/10/02
ςετʹৄ͍͠ํͱ͍͑͋ ͷํͰ͢Ͷʂ 7 Koichiro Oishi, 2017/10/02
͜Μͳ͜ͱΛฉ͖·ͨ͠ • Modelͷςετ͜Μͳ෩ʹॻ͍ͯΔ͚Ͳʁ • ௨৴෦։ൃαʔόͱ௨৴ͯ͠Δ͚ͲMockΛ ͬͨํ͕ྑ͍ʁ • ViewͷςετͲ͏͢Εྑ͍ʁ • ΧόϨοδʹ͍ͭͯ
8 Koichiro Oishi, 2017/10/02
Modelͷςετ͍·͜Μͳ෩ ʹॻ͍ͯ·͚͢ͲͲ͏Ͱ͢ ͔ʁ 9 Koichiro Oishi, 2017/10/02
͜Μͳ෩ʹॻ͍͍ͯ·ͨ͠ɻ 10 Koichiro Oishi, 2017/10/02
→ϝιου໊ྑ͍ ঢ়ଶͱظ͞ΕΔ݁Ռ͕ϝιου໊ʹॻ͔Ε͍ͯΔ 11 Koichiro Oishi, 2017/10/02
→ಉ͡ΫϥεͷςετͰά ϧʔϓԽͨ͠ΒΑ͍ • JUnitͰ͍͏Enclosed • RspecͰ͍͏describe →XCTestͩͱͰ͖ͳ͍ →QuickͩͱͰ͖ΔͬΆ͍? 12 Koichiro
Oishi, 2017/10/02
→ΫϥεͱςετΫϥε1 ରଟͰΑ͍ 13 Koichiro Oishi, 2017/10/02
௨৴෦։ൃαʔόͱ௨৴ ͯ͠Δ͚ͲMockΛͬͨํ ͕ྑ͍ʁ 14 Koichiro Oishi, 2017/10/02
→ඞͣ͠Θͳͯ͘ྑ͍ • MockΛ͏ͱɺMock͕ਖ਼͍༷͠Ͱ͋Δ͜ͱͷ ୲อ͕ඞཁʹͳΔ • ςετʹ͑Δ։ൃαʔό͕͋ΕͦͪΒͷํ͕ ίετ • ڥతʹ௨৴Ͱ͖ͳ͍ɺ͕͔͔࣌ؒΔͱ͍ͬͨ ߹MockΛݕ౼͢Δ
15 Koichiro Oishi, 2017/10/02
→Ͱ࣮ࡍʹ௨৴͢Δςετͨ·ʹ ࣦഊ͢Δ͜ͱ͕͋Δ • ඞͣޭ͢Δςετͱͨ·ʹࣦഊͯ͠͠·͏ςε τΛྨ →XcodeͳΒςετίʔυͷλʔήοτΛผʹ͢ ΔͳͲ • ྫ͑CIͰࣗಈςετ͢ΔͳΒࣦഊ͢Δςετ 3ճ࿈ଓͨ͠Βࣦഊͱఆ͢ΔͳͲ
16 Koichiro Oishi, 2017/10/02
ViewͷςετΒͳ͍ͱͩ ΊͰ͔͢ʁ 17 Koichiro Oishi, 2017/10/02
→ViewͷςετΑΓE2Eς ετΛͬͨํ͕ྑ͍ • ViewσβΠϯঢ়ଶ͕มΘΔ͔ΒɺView୯ମͷ ςετͱ͍͏ΑΓεϞʔΫςετE2Eςετ Λͬͨํ͕ྑ͍ → AppiumͳͲ • E2EςετΛߦ͏͜ͱͰਖ਼ৗܥͷςετࣗಈԽ
Ͱ͖Δ → ྫ֎ܥͷෳࡶͳςετਓ͕ؒΔඞཁ͕͋Δ 18 Koichiro Oishi, 2017/10/02
ΧόϨοδʹ͍ͭͯ 19 Koichiro Oishi, 2017/10/02
→ࢦ͖͢ΧόϨοδ • ·ͣϞσϧΛରʹ80ʙ90%Λࢦͤྑ͍ →100%Λࢦ͢ͷͭΒΈ͕૿͢߹ͷ͋Δ ͷͰඞͣ͠ࢦ͞ͳͯ͘Α͍ 20 Koichiro Oishi, 2017/10/02
→ࠓޙΧόϨοδΛҙࣝ͢ Δ͜ͱ • ΧόϨοδ͕ҡ࣋͞Ε͍ͯΔ → ಉ͡ൺͰςετ͕ॻ͔Ε͍ͯΔ ! • ΧόϨοδ͕Լ͕͍ͬͯΔ →
ςετ͕ॻ͔Ε͍ͯͳ͍ " 21 Koichiro Oishi, 2017/10/02
XCTestͳΒXcode্Ͱ֬ೝͰ ͖·͢Ͷʂ 22 Koichiro Oishi, 2017/10/02
͝੩ௌ͋Γ͕ͱ͏ ͍͟͝·ͨ͠ 23 Koichiro Oishi, 2017/10/02