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
74
iOSアプリ開発を始めよう
tamaki
0
110
詳解xcresult.pdf
tamaki
0
280
メルペイでのリグレッションテスト自動化推進のこれまでとこれから
tamaki
0
660
What do you want to test with UI Test v2
tamaki
2
830
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
【インフラエンジニアbooks】30分でわかる「AWS継続的セキュリティ実践ガイド」
hssh2_bin
1
250
Interfacing Kernel C APIs from Rust
ennael
PRO
0
190
山手線一周のパフォーマンス改善
suzukahr
0
110
【shownet.conf_】革新と伝統を融合したファシリティ
shownet
PRO
0
220
Strict Concurrencyにしたらdeinitでクラッシュする話
0si43
0
120
Amazon BedrockとPR-Agentでコードレビュー自動化に挑戦・実際に運用してみた
diggymo
0
540
分析者起点の企画を成功させた連携面の工夫
lycorptech_jp
PRO
0
210
【shownet.conf_】放送局とShowNetが共創する、未来の放送システム ~Media over IP 特別企画の裏側~
shownet
PRO
0
240
Oracle Cloud Infrastructure:2024年9月度サービス・アップデート
oracle4engineer
PRO
0
290
【swonet.conf_】NOCメンバーが語るSTMの実態!! ~ShowNetから若者への贈り物~
shownet
PRO
0
210
Authenticator のエミュレーションによる パスキーのログインテスト/nikkei-tech-talk-25
nikkei_engineer_recruiting
0
130
AWSへのNIST SP800-171管理策 導入に向けての整備/20240930 Mitsutoshi Matsuo
shift_evolve
0
140
Featured
See All Featured
A designer walks into a library…
pauljervisheath
201
24k
Building a Modern Day E-commerce SEO Strategy
aleyda
36
6.8k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
26
1.9k
A better future with KSS
kneath
235
17k
The Cost Of JavaScript in 2023
addyosmani
43
5.8k
A Philosophy of Restraint
colly
202
16k
Making the Leap to Tech Lead
cromwellryan
129
8.8k
Designing for humans not robots
tammielis
248
25k
Facilitating Awesome Meetings
lara
49
6k
Atom: Resistance is Futile
akmur
261
25k
Raft: Consensus for Rubyists
vanstee
136
6.6k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
158
15k
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/
Ҏ্