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
What's New in Testing!!!
Search
Shingo Tamaki
July 19, 2017
Technology
0
1.4k
What's New in Testing!!!
This document is a brief summary of the contents announced at WWDC 2017.
Shingo Tamaki
July 19, 2017
Tweet
Share
More Decks by Shingo Tamaki
See All by Shingo Tamaki
沖縄モバイルアプリ開発勉強会#1
tamaki
0
88
iOSアプリ開発を始めよう
tamaki
0
130
詳解xcresult.pdf
tamaki
0
310
メルペイでのリグレッションテスト自動化推進のこれまでとこれから
tamaki
0
690
What do you want to test with UI Test v2
tamaki
2
850
JPQRによって変わる日本のQRコード決済
tamaki
0
250
What's New in Testing
tamaki
1
58
What do you want to test with UI Test
tamaki
5
1.8k
How to control state in UI Test
tamaki
4
2.6k
Other Decks in Technology
See All in Technology
OpenAIの蒸留機能(Model Distillation)を使用して運用中のLLMのコストを削減する取り組み
pharma_x_tech
4
540
re:Invent をおうちで楽しんでみた ~CloudWatch のオブザーバビリティ機能がスゴい!/ Enjoyed AWS re:Invent from Home and CloudWatch Observability Feature is Amazing!
yuj1osm
0
120
大幅アップデートされたRagas v0.2をキャッチアップ
os1ma
2
520
組織に自動テストを書く文化を根付かせる戦略(2024冬版) / Building Automated Test Culture 2024 Winter Edition
twada
PRO
12
3.5k
Jetpack Composeで始めるServer Cache State
ogaclejapan
2
160
Wantedly での Datadog 活用事例
bgpat
1
420
[Ruby] Develop a Morse Code Learning Gem & Beep from Strings
oguressive
1
150
DevOps視点でAWS re:invent2024の新サービス・アプデを振り返ってみた
oshanqq
0
180
2024年にチャレンジしたことを振り返るぞ
mitchan
0
130
成果を出しながら成長する、アウトプット駆動のキャッチアップ術 / Output-driven catch-up techniques to grow while producing results
aiandrox
0
180
Microsoft Azure全冠になってみた ~アレを使い倒した者が試験を制す!?~/Obtained all Microsoft Azure certifications Those who use "that" to the full will win the exam! ?
yuj1osm
1
110
Amazon Kendra GenAI Index 登場でどう変わる? 評価から学ぶ最適なRAG構成
naoki_0531
0
100
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.3k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
The Cost Of JavaScript in 2023
addyosmani
45
7k
Thoughts on Productivity
jonyablonski
67
4.4k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Mobile First: as difficult as doing things right
swwweet
222
9k
Making Projects Easy
brettharned
116
5.9k
Transcript
What's New in Testing!!!
ࣗݾհ
ࣗݾհ ۄ৴ޛ iOS Engineer! ͖ͳframeworkHomeKitͱXCTestͰ͢ झຯ" ిࢠ࡞⚡ ےτϨ$ ΨδΣοτ%
Enhancements
xcodebuild • CoreSimulator • Prallel testing
͜Ε·ͰͷγϛϡϨʔλଟॏىಈ Xcode8.3·ͰSimulator.appͰͷىಈͰଟॏىಈΛαϙʔτ͠ ͍ͯͳ͔ͬͨɻ FBSimulatorControllͳͲΛ͍CoreSimulatorΛىಈͤ͞ Δํ๏͕͕͋ͬͨɺެࣜʹͦΕΛαϙʔτͨ͠ܗɻ FBSimulatorControl https://github.com/facebook/FBSimulatorControl
FBSimulatorControl
ͦͷଞͷଟॏγϛϡϨʔλଟॏىಈϥΠϒϥϦ FBSimulatorControlΑΓ࠶࣮ߦͳͲػೳ͕ଟ͍ͷͰXcode9Ҏ ߱ΘΕͦ͏ bluepill https://github.com/linkedin/bluepill
ؓٳ
Localization ςετ࣌ͷLanguage/Localࢦఆ͕ՄೳʹͳΓ·ͨ͠ɻ
Xcode Server XcodeʹXcode Serverͷػೳ͕͖ͭ·ͨ͠ɻ
Block-based test teardown
Async Testing ඇಉظͷ୯ମͱςετʹ͍ͭͯ͜Ε·ͰXCTExpectationΛ ͍ͬͯ·ͨ͠ɻ
Limitations • λΠϜΞτͷ߹ඞࣦͣഊͱͯ͠ѻΘΕͯ͠·͍·͢ɻ • ΣΠτॲཧ͕ඞཁͱͳΔ • ΤϥʔͷݪҼ͕ಛఆͮ͠Β͍ • ωετͨ͠ΤΠτॲཧ͕ग़དྷͳ͍
XCTWaiter • XCTWaiterͱͯ͠ΣΠτॲཧʹؔ͢Δ෦͕XCTestCase͔ Β͠·ͨ͠ɻ • ରͱͳΔexpectationΛ໌ࣔతʹෳͰ͖ΔΑ͏ʹͳΓ·͠ ͨɻ • XCTWaiterʹ߹ΘͤͯDelegateΫϥεఆٛ͞Ε·ͨ͠ •
Returns XCTWaiter.Result
XCTWaiter
XCTWaiter
XCTWaiter.Result XCWaiter.Result͕ఆٛ͞Εɺ࣮ߦ݁Ռͱͯ͠ҎԼͷΑ͏ͳͷ ͕ఆٛ͞Ε͍ͯ·͢ɻ • completed • timedOut • incorrectOrder •
invertedFulfillment • interrupted
XCTTestExpectation XCTWaiterʹ߹ΘͤͯXCTTestExpectation֦ு͞Ε·ͨ͠ɻ (Xcode8.3ͰՃ) • ΠχγϟϥΠβ͕͖ͭ·ͨ͠ • expectationDescriptionͰDescriptionͷมߋ͕ग़དྷΔ Α͏ʹͳΓ·ͨ͠ɻ • expectedFulfillmentCountͷઃఆʹΑͬͯɺfulfill()ͷճʹ
ΑΔࢦఆ͕ग़དྷΔΑ͏ʹͳΓ·ͨ͠ɻͭ·Γ
XCTTestExpectation • isInvertedϓϩύςΟʹΑͬͯςετͷޭ/ࣦഊΛٯస͞ ͤΔ͜ͱ͕ग़དྷ·͢ɻ͜ΕͰλΠϜΞτͰޭͱ͢Δ͜ ͱ͕Ͱ͖·͢Ͷɻ • wait(for:timeout:enforceOrder:)ͷΑ͏ʹexpectationͷ ྃॱΛࢦఆ͢Δ͜ͱ͕Ͱ͖·͢
XCTWaiterDelegate • nestedWaiter(_:wasInterruptedByTimedOutWaiter:) • waiter(_:didTimeoutWithUnfulfilledExpectations:) • waiter(_:didFulfillInvertedExpectation:) • waiter(_:fulfillmentDidViolateOrderingConstraintsFor:requir edExpectation:)
Multi-app Testing
Multi-app Testing UI Testing͜Ε·Ͱ1ͭͷΞϓϦέʔγϣϯʹରͯ͠ߦ͏ͷ Ͱͨ͠ɺ͔͠͠Xcode9͔ΒىಈରͷΞϓϦΛࢦఆ͢ΔࣄͰෳ ΞϓϦͷىಈ͕UI TestingͰߦ͑ΔΑ͏ʹͳΓ·ͨ͠ɻ
XCUIApplication • New initializer • init(bundleIdentifier: String)ͰରΞϓϦͷ BundleIDΛࢦఆ • init(url:
URL)Ճ͞Ε·͕ͨ͠MacOSͷΈͳͷͰઆ ໌লུ(ௐͯͳ͍)
XCUIApplication • Activate • ΞϓϦlaunch()Ͱىಈ͠·͕͢ɺෳΞϓϦΛίϯτ ϩʔϧ͢Δࡍɺactivate()Λ͏͜ͱʹΑͬͯΞϓϦͷ Γସ͑Λߦ͍·͢ɻ • State property
• ෳͷΞϓϦΛΓସ͑ͨΓ͢Δ͜ͱΛఆ͢Δʹ͋ͨ ΓɺΞϓϦͷঢ়ଶΛఆٛͨ͠ϓϩύςΟ͕Ճ͞Ε·ͨ͠
XCUIApplication
UI Testing performance
FirstMatch API firstMatchΛ͏͜ͱͰͰUIElementͷݕࡧʹஔ͍ͯ࠷ॳʹݟ ͚ͭͨ࣌ͰݕࡧΛൈ͚Δࣄ͕ग़དྷΔΑ͏ʹͳΓ·ͨ͠ɻ
FirstMatch API વͰ͕͢ɺۃྗཁૉΛߜΔ݅ࡉ͔͍ํ͕ྑ͍Ͱ͢ɻ
Activities, attachments, and screenshots
Activities ςετͷखॱΛϒϩοΫͰแΜͰ໊લΛ͚ͭΔ͜ͱ͕ग़དྷΔΑ ͏ʹͳΓ·ͨ͠ɻ
͜Ε·Ͱͷςετ
͜Ε·Ͱͷςετ
͜Ε͔Βͷςετ
࣮ߦϩά͔Βݟͨҧ͍ ࡉ͔ͳखॱͰͳ͘γφϦΦͱͯ͠Θ͔Γ͍͢ܗʹ
Attachment ςετ࣌ʹՃͷϩάΠϝʔδͳͲΛ͢͜ͱ͕Ͱ͖ΔΑ͏ ʹͳΓ·ͨ͠ɻ
Screenshots ͜Ε·ͰͷࣗಈεΫϦʔϯγϣοτͰͳ͘ɺదͳλΠϛϯ άͰεΫϦʔϯγϣοτΛࡱΕΔΑ͏ʹͳΓ·ͨ͠ɻ
Screenshots
Attachment Lifetime Policies εΫϦʔϯγϣοτΞλονϝϯτςετྃ࣌ʹআ͢ ΔͳͲͷઃఆՄೳʹͳΓ·͢ɻ
https:// developer.apple.com /videos/play/ wwdc2017/409/
Ҏ্