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
"Meet Swift Testing" & "Go further with Swift T...
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
log5
July 02, 2024
Technology
360
0
Share
"Meet Swift Testing" & "Go further with Swift Testing" in 5 min
「集まれSwift好き!Swift愛好会スピンオフ WWDC24セッション要約会 @ DeNA」 における発表資料
log5
July 02, 2024
More Decks by log5
See All by log5
App Clip 5年史: 萌動と停滞のクロニクル
judau
0
3.1k
"Record, replay, and review: UI automation with Xcode" の要約
judau
1
230
懐かしきCaboChaのレシピをもう一度
judau
0
150
App Clipの魔法: iOSデザイン開発の新時代
judau
4
8.7k
AppCodeのサ終から半年後
judau
1
230
Aquaの波紋によせて
judau
0
170
iOSは自動作曲の夢を見るか
judau
0
1.8k
What's New in App Clips after WWDC23
judau
1
180
「そういえば何でテストエンジニアやめたん?」〜5年前の振り返りなの
judau
0
240
Other Decks in Technology
See All in Technology
試作とデモンストレーション / Prototyping and Demonstrations
ks91
PRO
0
190
AI時代に越境し、 組織を変えるQAスキルの正体 / QA Skills for Transforming an Organization
mii3king
5
4.1k
サンプリングは「作る」のか「使う」のか? 分散トレースのコストと運用を両立する実践的戦略 / Why you need the tail sampling and why you don't want it
ymotongpoo
3
130
生成AIが変える SaaS の競争原理と弁護士ドットコムのプロダクト戦略
bengo4com
1
3.6k
会社説明資料|株式会社ギークプラス ソフトウェア事業部
geekplus_tech
0
200
ボトムアップの改善の火を灯し続けろ!〜支援現場で学んだ、消えないための3つの打ち手〜 / 20260509 Kazuki Mori
shift_evolve
PRO
2
590
古今東西SRE
okaru
1
140
生成AI時代に信頼性をどう保ち続けるか - Policy as Code の実践
akitok_
0
130
GKE Agent SandboxでAIが生成したコードを 安全に実行してみた
lamaglama39
0
210
[Oracle TechNight#99] 生成AI時代のAI/ML入門 ~ AIとオラクルデータベースの関係 (後半)
oracle4engineer
PRO
3
240
そのSLO 99.9%、本当に必要ですか? 〜優先度付きSLOによる責任共有の設計思想〜 / Is that 99.9% SLO really necessary? Design philosophy of shared responsibility through prioritized SLOs
vtryo
0
110
[Oracle TechNight#99] 生成AI時代のAI/ML入門 ~ AIとオラクルデータベースの関係 (前半)
oracle4engineer
PRO
2
240
Featured
See All Featured
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
Exploring anti-patterns in Rails
aemeredith
3
350
Ruling the World: When Life Gets Gamed
codingconduct
0
220
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.3k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
510
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.7k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
140
Designing Experiences People Love
moore
143
24k
GraphQLとの向き合い方2022年版
quramy
50
15k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
130
Transcript
Meet Swift Testing Go further with Swift Testing log5 at
ू·ΕSwift͖ʂSwiftѪձεϐϯΦϑ WWDC24ηογϣϯཁձ @ DeNA Λ5Ͱཧղ͢Δ·ͱΊ
Meet Swift Testing
Swift Testing ͱ • SwiftίʔυͷςετΛ༰қ͔ͭڧྗʹ • Φʔϓϯιʔεύοέʔδ
ϞμϯͳSwiftͱͷ౷߹ • Async/await Actor isolation Λαϙʔτ • ϚΫϩʹΑΔৄࡉͳΤϥʔϨϙʔτ
ॊೈͳςετઃܭ JUnitͱ͔TestNGͱ͔ͰݟͨΞϨ • ͖݅ςετ࣮ߦ • ΧελϜλάʹΑΔςετͷάϧʔϓԽ • ύϥϝʔλϥΠζυɾςετ • ෳͷҾͰςετΛ܁Γฦ࣮͠ߦ
XCTestͱԿ͕ҧ͏? • ΑΓ໌ࣔతͳςετࢦఆ • ͏ testͳΜͱ͔ͱ͍͏ϝιου͡Όͳ͍͍ͯ͘ • γϯϓϧͳظνΣοΫ • XCTAssertGreaterThanͳΜͱ͔֮͑ͳͯ͘ྑ͍
• structͰςετεΠʔτ͕ॻ͚Δ
ΦʔϓϯιʔεͱϚϧνϓϥοτϑΥʔϜ • ιʔείʔυ͕GitHub্ʹ • ίϛϡχςΟओಋͷ։ൃ • AppleϓϥοτϑΥʔϜ͚ͩͰͳ͘LinuxWindowsαϙʔτ
ϙΠϯτ • ςετؔ (@Test attribute) • ظνΣοΫ (#expectϚΫϩ) • τϨΠτ
(@available ͷؒΈ͍ͨͳͷ) • ςετεΠʔτ (@Suite ͰςετΛάϧʔϓԽ)
Swift Testing ʹ͍ͭͯ ཁ͢Δʹ • Swift Testing • Xcode 16Swift
Package Managerͱ౷߹ • طଘͷXCTestͱڞଘՄೳ • ςετͷ্࣭ͱޮԽ
Go further with Swift Testing
Swift Testingͷৄࡉ • Swift TestingͰςετΛڧԽʂ • Մಡੑɺཏੑɺ৫Խɺฒྻ࣮ߦ
දݱྗUP • ΤϥʔϋϯυϦϯάͷςετ͕༰қͳ expect throwsϚΫϩ • OptionalͷݕূʹϐολϦͳ required • ͳΜ͔όάͰ௨ͤͳ͍ͱ͖
withKnownIssue • CustomTestStringConvertible ͰΘ͔Γ͍͢Τϥʔϝοηʔδ • ςετ࣌ͷϩάΛ͖ʹͰ͖Δ → ςετϨϙʔτಡΈ͍͢
ύϥϝʔλϥΠζυɾςετ ੲ͔Β͜ΕຊޠͰͳΜ͍ͯ͏ͷ͔Α͘Θ͔ΒΜ • 1ͭͷςετؔͰෳͷέʔεΛΧόʔ • For-each෦ͰͷΞαʔγϣϯ͕खܰʹ • ෳͷೖྗύϥϝʔλʹରԠ • ςετέʔεͷΈ߹ΘͤΛࣗಈੜ
• (ΦʔϧϖΞ๏ʢϖΞϫΠζ๏ʣ͕ग़ͯ͘Δ͔ͱظ͚ͨ͠Ͳҧͬͨ)
৫Խ (ͬͯ༁ޠ͋ͬͯΔʁ) • ωετ͞ΕͨςετεΠʔτ • @Tag ʹΑΔςετͷؔ࿈͚ͱ࣮ߦ੍ޚ • Xcodeͷ৽ػೳΛ׆༻ͨ͠λάϕʔεςετཧ
ςετͷฒྻ࣮ߦ • σϑΥϧτͰฒྻ࣮ߦ → ߴԽ • ςετؒͷӅΕͨґଘ͕ؔݟ͔ͭΔ • ͍͖ͳΓγϟοϑϧͰ͖ͳ͍ͳΒ.serializedτϨΠτͰஞ࣮࣍ߦ
ඇಉظςετ • Swift Concurrencyͱͷ౷߹ • try await confirmation • Completion
Handler event handler ͷςετʹͽͬͨΓ • (ݸਓతʹ5લʹObjective-CͷϓϩδΣΫτͰཉ͔ͬͨ͠ʣ
Swift Testing ͷৄࡉ ͭ·ΓͲΏ͜ͱ • Swift Testing • ςετίʔυͷ࣭ͱޮΛେ෯ʹ্ •
Xcodeͱ౷߹͞Ε͍͍ͯͯ͢ (Xcodeࣗମ͕͍͍͔͢ॾઆ͕) • Test PlanXcode CloudͰ׆༂ • ΑΓ৴པੑͷߴ͍ιϑτΣΞΛޮతʹ։ൃ
ϫΠͦΖͦΖiOS։ൃͨ͘͠ͳ͖ͬͯͨ(´ɾТɾʆ) Happy Testing!