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
79
iOSアプリ開発を始めよう
tamaki
0
120
詳解xcresult.pdf
tamaki
0
290
メルペイでのリグレッションテスト自動化推進のこれまでとこれから
tamaki
0
670
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
生成AIと知識グラフの相互利用に基づく文書解析
koujikozaki
1
140
Java x Spring Boot Warm up
kazu_kichi_67
2
490
[AWS JAPAN 生成AIハッカソン] Dialog の紹介
yoshimi0227
0
150
事業者間調整の行間を読む 調整の具体事例
sugiim
0
1.3k
顧客が本当に必要だったもの - パフォーマンス改善編 / Make what is needed
soudai
24
6.7k
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
3.6k
オーティファイ会社紹介資料 / Autify Company Deck
autifyhq
9
120k
AWS CDKでデータリストアの運用、どのように設計する?~Aurora・EFSの実践事例を紹介~/aws-cdk-data-restore-aurora-efs
mhrtech
4
640
Nix入門パラダイム編
asa1984
2
200
サイバーエージェントにおける生成AIのリスキリング施策の取り組み / cyber-ai-reskilling
cyberagentdevelopers
PRO
2
200
グローバル展開を見据えたサービスにおける機械翻訳プラクティス / dp-ai-translating
cyberagentdevelopers
PRO
1
150
GitHub Universe: Evaluating RAG apps in GitHub Actions
pamelafox
0
170
Featured
See All Featured
A Philosophy of Restraint
colly
203
16k
GitHub's CSS Performance
jonrohan
1030
460k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Scaling GitHub
holman
458
140k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Code Reviewing Like a Champion
maltzj
519
39k
How to Think Like a Performance Engineer
csswizardry
19
1.1k
How to Ace a Technical Interview
jacobian
275
23k
Facilitating Awesome Meetings
lara
49
6k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
790
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
355
29k
Building Adaptive Systems
keathley
38
2.2k
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/
Ҏ্