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
log5
July 02, 2024
Technology
0
320
"Meet Swift Testing" & "Go further with Swift Testing" in 5 min
「集まれSwift好き!Swift愛好会スピンオフ WWDC24セッション要約会 @ DeNA」 における発表資料
log5
July 02, 2024
Tweet
Share
More Decks by log5
See All by log5
"Record, replay, and review: UI automation with Xcode" の要約
judau
1
130
懐かしきCaboChaのレシピをもう一度
judau
0
110
App Clipの魔法: iOSデザイン開発の新時代
judau
4
7.9k
AppCodeのサ終から半年後
judau
1
210
Aquaの波紋によせて
judau
0
140
iOSは自動作曲の夢を見るか
judau
0
1.5k
What's New in App Clips after WWDC23
judau
1
150
「そういえば何でテストエンジニアやめたん?」〜5年前の振り返りなの
judau
0
200
App Clips はどこから来たのか&何者か&どこへ行くのか
judau
1
1.1k
Other Decks in Technology
See All in Technology
知られざるprops命名の慣習 アクション編
uhyo
11
2.6k
[CV勉強会@関東 CVPR2025 読み会] MegaSaM: Accurate, Fast, and Robust Structure and Motion from Casual Dynamic Videos (Li+, CVPR2025)
abemii
0
200
Claude Code x Androidアプリ 開発
kgmyshin
1
590
TypeScript入門
recruitengineers
PRO
23
7.2k
ZOZOTOWNフロントエンドにおけるディレクトリの分割戦略
zozotech
PRO
18
5.5k
実践アプリケーション設計 ③ドメイン駆動設計
recruitengineers
PRO
3
280
トヨタ生産方式(TPS)入門
recruitengineers
PRO
3
310
Effective Match Types - Scala Days 2025
bishabosha
1
110
AIドリブンのソフトウェア開発 - うまいやり方とまずいやり方
okdt
PRO
9
640
あとはAIに任せて人間は自由に生きる
kentaro
3
1.1k
開発と脆弱性と脆弱性診断についての話
su3158
1
1.1k
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
30k
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.6k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.9k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
Producing Creativity
orderedlist
PRO
347
40k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6k
Typedesign – Prime Four
hannesfritz
42
2.8k
Git: the NoSQL Database
bkeepers
PRO
431
65k
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!