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
290
メルペイでのリグレッションテスト自動化推進のこれまでとこれから
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
Engineer Career Talk
lycorp_recruit_jp
0
150
OCI 運用監視サービス 概要
oracle4engineer
PRO
0
4.8k
安心してください、日本語使えますよ―Ubuntu日本語Remix提供休止に寄せて― 2024-11-17
nobutomurata
1
990
OCI Network Firewall 概要
oracle4engineer
PRO
0
4.1k
Lambdaと地方とコミュニティ
miu_crescent
2
370
[CV勉強会@関東 ECCV2024 読み会] オンラインマッピング x トラッキング MapTracker: Tracking with Strided Memory Fusion for Consistent Vector HD Mapping (Chen+, ECCV24)
abemii
0
220
AIチャットボット開発への生成AI活用
ryomrt
0
170
Introduction to Works of ML Engineer in LY Corporation
lycorp_recruit_jp
0
100
Terraform未経験の御様に対してどの ように導⼊を進めていったか
tkikuchi
2
430
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.6k
Why App Signing Matters for Your Android Apps - Android Bangkok Conference 2024
akexorcist
0
120
dev 補講: プロダクトセキュリティ / Product security overview
wa6sn
1
2.3k
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
136
6.6k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Site-Speed That Sticks
csswizardry
0
23
Agile that works and the tools we love
rasmusluckow
327
21k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Building Your Own Lightsaber
phodgson
103
6.1k
What's in a price? How to price your products and services
michaelherold
243
12k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
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/
Ҏ্