Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Swift Testingのモチベを上げたい

Swift Testingのモチベを上げたい

Swift愛好会 vol92の談義資料

stotic-dev

March 04, 2025
Tweet

More Decks by stotic-dev

Other Decks in Programming

Transcript

  1. ςετͷ࣮ߦ଎౓ • Swift Testing͸σϑΥϧτͰฒྻ࣮ߦ͞ΕΔ • ύϥϝλϥΠζυςετͷ࣮ߦ΋ฒྻ࣮ߦʹͳΔ • Swift TestingͱXCTestͷฒྻ࣮ߦʹ͸ҎԼҧ͍͕͋Δ •

    XCTest: ෳ਺ϓϩηεͰҰͭͷςετΛ࣮ߦ͢Δ • Swift Testing: ҰͭͷϓϩηεͰฒྻ࣮ߦ͢Δ ϓϩηε1 ϓϩηε2 ϓϩηε3 7 6 5 4 1 2 3 ϓϩηε1 1 2 3 7 6 5 4 XCTestͷฒྻςετख๏ Swift Testingͷฒྻςετख๏ ϓϩηεͷ্ཱͪ͛΍ϝϞϦͰΦʔόʔϔου
  2. ಋೖʹ͋ͨͬͯͷݒ೦఺ & ஫ҙ఺ • ಋೖ͕େมͦ͏ • XCTestͱڞଘͰ͖Δ͔Βେৎ෉ʂ • Xcode16͔Β͸ඪ४Ͱ૊Έࠐ·Ε͍ͯΔʂ(Xcode15ҎԼͰ͸SPMͰಋೖ͢Δඞཁ͋Γ) •

    Xcode16ະຬͷ৔߹Ͱ΋SPM͔ΒಋೖՄೳʂ • UITest(XCUIApplication)΍ੑೳςετ(XCTMetric)͸Swift Testingͷαϙʔτ֎ͳͷͰɺ Ҿ͖ଓ͖XCTestΛ࢖͏ඞཁ͕͋Δ • ύϥϝλϥΠζυςετΛཚ༻͢ΔͱՄಡੑ͕Լ͕Γͦ͏ • OSS ϩάformatterͰςετ݁Ռ͕Ұ෦ग़ྗ͞Εͳ͍
  3. ·ͱΊ • Swift TestingΛಋೖ͢Δʹ͋ͨͬͯͷݒ೦఺ • ύϥϝλϥΠζυςετͷཚ༻ʹΑΔՄಡੑͷ௿Լ • ਖ਼ৗܥͱҟৗܥͰέʔεΛ෼͚ΔͳͲɺέʔε͔Βݕূ͢ΔৼΔ෣͍͕ಡΈऔΕΔཻ౓Ͱ׆ ༻͢Δ •

    OSS formatterͰ͸Swift Testingͷςετ݁ՌΛग़ྗͰ͖ͳ͍έʔε͕͋Δ • xcresultΛιʔεʹѻ͏Α͏ʹ͢Δ • ΫϦςΟΧϧͳݒ೦͸جຊͳ͍ͷͰɺಋೖ͍ͨ͠ʂʂ
  4. ࢀߟ • https://developer.apple.com/videos/play/wwdc2024/10179 • https://developer.apple.com/videos/play/wwdc2024/10195/ • https://developer.apple.com/documentation/testing/de f iningtests •

    https://developer.apple.com/documentation/testing/parameterizedtesting • https://developer.apple.com/documentation/testing/migratingfromxctest#Check-for-expected-values-and-outcomes • https://leocoout.medium.com/welcome-swift-testing-goodbye-xctest-7501b7a5b304 • https://developer.apple.com/documentation/testing/parallelization • https://github.com/xcpretty/xcpretty/issues/295 • https://github.com/swiftlang/swift-testing • https://qiita.com/bsj-k-hashikawa/items/603b7b842fede13942ca • https://qiita.com/yonetty/items/ 447cd47fe5d37473cb2d#%E6%A7%8B%E9%80%A0%E5%8C%96%E3%81%95%E3%82%8C%E3%81%A6%E3%81%84%E3 %82%8Bstructured • ୯ମςετͷߟ͑ํ/࢖͍ํ (ஶ) Vladimir Khorikov (༁) ਢాஐ೭