View in English

  • Apple Developer
    • 시작하기

    시작하기 탐색

    • 개요
    • 알아보기
    • Apple Developer Program

    알림 받기

    • 최신 뉴스
    • Hello Developer
    • 플랫폼

    플랫폼 탐색

    • Apple 플랫폼
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store

    피처링

    • 디자인
    • 배포
    • 게임
    • 액세서리
    • 웹
    • 홈
    • CarPlay
    • 기술

    기술 탐색

    • 개요
    • Xcode
    • Swift
    • SwiftUI

    피처링

    • 손쉬운 사용
    • 앱 인텐트
    • Apple Intelligence
    • 게임
    • 머신 러닝 및 AI
    • 보안
    • Xcode Cloud
    • 커뮤니티

    커뮤니티 탐색

    • 개요
    • Apple과의 만남 이벤트
    • 커뮤니티 주도 이벤트
    • 개발자 포럼
    • 오픈 소스

    피처링

    • WWDC
    • Swift Student Challenge
    • 개발자 이야기
    • App Store 어워드
    • Apple 디자인 어워드
    • 문서

    문서 탐색

    • 문서 라이브러리
    • 기술 개요
    • 샘플 코드
    • 휴먼 인터페이스 가이드라인
    • 비디오

    릴리즈 노트

    • 피처링 업데이트
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • tvOS
    • Xcode
    • 다운로드

    다운로드 탐색

    • 모든 다운로드
    • 운영 체제
    • 애플리케이션
    • 디자인 리소스

    피처링

    • Xcode
    • TestFlight
    • 서체
    • SF Symbols
    • Icon Composer
    • 지원

    지원 탐색

    • 개요
    • 도움말
    • 개발자 포럼
    • 피드백 지원
    • 문의하기

    피처링

    • 계정 도움말
    • 앱 심사 지침
    • App Store Connect 도움말
    • 새로 추가될 요구 사항
    • 계약 및 지침
    • 시스템 상태
  • 빠른 링크

    • 이벤트
    • 뉴스
    • 포럼
    • 샘플 코드
    • 비디오
 

비디오

메뉴 열기 메뉴 닫기
  • 컬렉션
  • 전체 비디오
  • 소개

더 많은 비디오

  • 소개
  • 요약
  • 코드
  • Swift Testing으로 마이그레이션하기

    테스트 프레임워크 상호 운용성을 활용하여 XCTest와 함께 Swift Testing을 두려움 없이 도입하는 방법을 알아보세요. 개발을 가속화하고 커버리지를 확장하는 고급 테스트 기능을 점진적으로 도입하기 위한 모범 사례와 패턴을 살펴보세요.

    챕터

    • 0:07 - Introduction
    • 1:08 - Swift Testing basics
    • 2:50 - Migration strategy
    • 5:48 - Test framework interoperability
    • 7:43 - Interoperability modes
    • 13:02 - Common migration patterns
    • 15:34 - Parameterized tests
    • 18:02 - Exit tests
    • 20:04 - Next steps

    리소스

      • HD 비디오
      • SD 비디오

    관련 비디오

    WWDC26

    • Swift의 새로운 기능

    WWDC24

    • Swift Testing 소개
    • Swift Testing으로 테스트 심화하기
  • 비디오 검색…
    • 1:12 - Name a test using a raw identifier

      import Testing
      
      @testable import DemoApp
      
      @Test func `Default climate: tropical`() async throws {
          let fruit = Fruit(name: "Coconut")
          #expect(fruit.climate == .tropical)
      }
    • 5:03 - Wrap XCTFail in a test helper function

      func testUniqueFruitNames() async throws {
          assertUnique(Market.fruits + [Fruit.lychee])
      }
      
      // TestHelpers.swift
      
      func assertUnique(_ fruits: [Fruit], file: StaticString = #filePath, line: UInt = #line) {
          var uniqueNames = Set<String>()
          for name in fruits.map(\.name) {
              if !uniqueNames.insert(name).inserted {
                  XCTFail("Duplicate name: \(name)", file: file, line: line)
              }
          }
      }
    • 10:12 - Replace XCTFail with Issue.record in the test helper

      import Testing
      
      func assertUnique(_ fruits: [Fruit], sourceLocation: SourceLocation = ...) {
          var uniqueNames = Set<String>()
          for name in fruits.map(\.name) {
              if !uniqueNames.insert(name).inserted {
                  Issue.record("Duplicate name: \(name)", sourceLocation: sourceLocation)
              }
          }
      }
    • 12:15 - Run Swift Package tests with the strict interoperability mode from Terminal

      > SWIFT_TESTING_XCTEST_INTEROP_MODE=strict swift test
    • 13:10 - Common migration: skipping tests

      let isFall = false
      
      // XCTest
      func testSwallowFallMigration() async throws {
          try XCTSkipIf(!isFall, "Wrong season for migration")
          // ...
      }
      
      // Test.cancel interoperability from Swift Testing
      func testSwallowFallMigration() async throws {
          if !isFall {
              try Test.cancel("Wrong season for migration")
          }
          // ...
      }
      
      // ✅ Prefer test trait in Swift Testing
      @Test(.enabled(if: isFall, "Wrong season for migration"))
      func `Swallow fall migration`() async throws {
         // ...
      }
    • 13:41 - Common migration: halting after test failures

      func testExample() async throws {
          #expect(Fruit.banana.climate == .temperate)
      
          try #require(Fruit.banana == Fruit.plantain)
          XCTFail("This is never reached")
      }
    • 15:57 - Example of nested loops which can be converted into a parameterized @Test function

      struct BirdTests {
      
          @Test func `Birds flap wings successfully`() async throws {
              for bird in Aviary.birds {
                  for count in (40...100) {
                      try await bird.flapWings(count: count)
                  }
              }
          }
      
      }
    • 16:47 - Refactor nested loops into a parameterized @Test function

      struct BirdTests {
      
          @Test(arguments: Aviary.birds, 40...100)
          func `Birds flap wings successfully`(bird: Bird, count: Int) async throws {
              try await bird.flapWings(count: count)
          }
      
      }
    • 18:21 - Precondition check on empty input name in an initializer

      // In `Bird.init(...)`
      if name.isEmpty {
          preconditionFailure("Bird name cannot be empty")
      }
    • 19:27 - Add coverage for precondition failure with exit test

      extension BirdTests {
      
          @Test func `Bird with empty name crashes`() async throws {
              await #expect(processExitsWith: .failure) {
                  _ = Bird(name: "")
              }
          }
      
      }
    • 0:07 - Introduction
    • How to fearlessly migrate from XCTest to Swift Testing using the new interoperability feature.

    • 1:08 - Swift Testing basics
    • A quick review of core Swift Testing building blocks — the @Test macro, #expect, and how they compare to XCTest assertions.

    • 2:50 - Migration strategy
    • Covers the recommended incremental approach: leave existing XCTests in place, and start writing new tests in Swift Testing right away.

    • 5:48 - Test framework interoperability
    • Introduces the interoperability feature that lets you safely call XCTest or Swift Testing API from within a test belonging to the other framework.

    • 7:43 - Interoperability modes
    • Walks through the four interoperability modes — Limited, Complete, Strict, and None — and how to configure them in Xcode Test Plans and Swift packages.

    • 13:02 - Common migration patterns
    • Covers practical patterns you will encounter during migration, including replacing XCTSkip with Test.cancel or traits, and continueAfterFailure with #require.

    • 15:34 - Parameterized tests
    • Shows how to replace loop-based XCTest cases with Swift Testing parameterized tests for faster parallel execution and clearer failure reporting.

    • 18:02 - Exit tests
    • Demonstrates how to use Swift Testing exit tests to cover code paths that call preconditionFailure or crash, running them safely in a child process.

    • 20:04 - Next steps
    • Recaps the migration path, highlights Swift Testing open-source availability and cross-platform support, and encourages community participation.

Developer Footer

  • 비디오
  • WWDC26
  • Swift Testing으로 마이그레이션하기
  • 메뉴 열기 메뉴 닫기
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    메뉴 열기 메뉴 닫기
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • SF Symbols
    메뉴 열기 메뉴 닫기
    • 손쉬운 사용
    • 액세서리
    • Apple Intelligence
    • 앱 확장 프로그램
    • App Store
    • 오디오 및 비디오(영문)
    • 증강 현실
    • 디자인
    • 배포
    • 교육
    • 서체(영문)
    • 게임
    • 건강 및 피트니스
    • 앱 내 구입
    • 현지화
    • 지도 및 위치
    • 머신 러닝 및 AI
    • 오픈 소스(영문)
    • 보안
    • Safari 및 웹(영문)
    메뉴 열기 메뉴 닫기
    • 문서(영문)
    • 튜토리얼
    • 다운로드
    • 포럼(영문)
    • 비디오
    메뉴 열기 메뉴 닫기
    • 지원 문서
    • 문의하기
    • 버그 보고
    • 시스템 상태(영문)
    메뉴 열기 메뉴 닫기
    • Apple Developer
    • App Store Connect
    • 인증서, 식별자 및 프로파일(영문)
    • 피드백 지원
    메뉴 열기 메뉴 닫기
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program(영문)
    • Mini Apps Partner Program
    • News Partner Program(영문)
    • Video Partner Program(영문)
    • Security Bounty Program(영문)
    • Security Research Device Program(영문)
    메뉴 열기 메뉴 닫기
    • Apple과의 만남
    • Apple Developer Center
    • App Store 어워드(영문)
    • Apple 디자인 어워드
    • Apple Developer Academy(영문)
    • WWDC
    최신 뉴스 읽기.
    Apple Developer 앱 받기.
    Copyright © 2026 Apple Inc. 모든 권리 보유.
    약관 개인정보 처리방침 계약 및 지침