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
82
iOSアプリ開発を始めよう
tamaki
0
120
詳解xcresult.pdf
tamaki
0
300
メルペイでのリグレッションテスト自動化推進のこれまでとこれから
tamaki
0
680
What do you want to test with UI Test v2
tamaki
2
840
JPQRによって変わる日本のQRコード決済
tamaki
0
240
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.5k
Other Decks in Technology
See All in Technology
TypeScriptの次なる大進化なるか!? 条件型を返り値とする関数の型推論
uhyo
2
1.7k
FlutterアプリにおけるSLI/SLOを用いたユーザー体験の可視化と計測基盤構築
ostk0069
0
100
SREが投資するAIOps ~ペアーズにおけるLLM for Developerへの取り組み~
takumiogawa
1
430
ドメインの本質を掴む / Get the essence of the domain
sinsoku
2
160
アジャイルでの品質の進化 Agile in Motion vol.1/20241118 Hiroyuki Sato
shift_evolve
0
170
マルチプロダクトな開発組織で 「開発生産性」に向き合うために試みたこと / Improving Multi-Product Dev Productivity
sugamasao
1
310
OTelCol_TailSampling_and_SpanMetrics
gumamon
1
200
リンクアンドモチベーション ソフトウェアエンジニア向け紹介資料 / Introduction to Link and Motivation for Software Engineers
lmi
4
300k
【Startup CTO of the Year 2024 / Audience Award】アセンド取締役CTO 丹羽健
niwatakeru
0
1.3k
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.7k
アプリエンジニアのためのGraphQL入門.pdf
spycwolf
0
100
Lambdaと地方とコミュニティ
miu_crescent
2
370
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
A designer walks into a library…
pauljervisheath
204
24k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
What's new in Ruby 2.0
geeforr
343
31k
Adopting Sorbet at Scale
ufuk
73
9.1k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Gamification - CAS2011
davidbonilla
80
5k
YesSQL, Process and Tooling at Scale
rocio
169
14k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Facilitating Awesome Meetings
lara
50
6.1k
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/
Ҏ্