View in English

  • Apple Developer
    • Get Started

    Explore Get Started

    • Overview
    • Learn
    • Apple Developer Program

    Stay Updated

    • Latest News
    • Hello Developer
    • Platforms

    Explore Platforms

    • Apple Platforms
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store

    Featured

    • Design
    • Distribution
    • Games
    • Accessories
    • Web
    • Home
    • CarPlay
    • Technologies

    Explore Technologies

    • Overview
    • Xcode
    • Swift
    • SwiftUI

    Featured

    • Accessibility
    • App Intents
    • Apple Intelligence
    • Games
    • Machine Learning & AI
    • Security
    • Xcode Cloud
    • Community

    Explore Community

    • Overview
    • Meet with Apple events
    • Community-driven events
    • Developer Forums
    • Open Source

    Featured

    • WWDC
    • Swift Student Challenge
    • Developer Stories
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Centers
    • Documentation

    Explore Documentation

    • Documentation Library
    • Technology Overviews
    • Sample Code
    • Human Interface Guidelines
    • Videos

    Release Notes

    • Featured Updates
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • tvOS
    • Xcode
    • Downloads

    Explore Downloads

    • All Downloads
    • Operating Systems
    • Applications
    • Design Resources

    Featured

    • Xcode
    • TestFlight
    • Fonts
    • SF Symbols
    • Icon Composer
    • Support

    Explore Support

    • Overview
    • Help Guides
    • Developer Forums
    • Feedback Assistant
    • Contact Us

    Featured

    • Account Help
    • App Review Guidelines
    • App Store Connect Help
    • Upcoming Requirements
    • Agreements and Guidelines
    • System Status
  • Quick Links

    • Events
    • News
    • Forums
    • Sample Code
    • Videos
 

Vídeos

Abrir menu Fechar menu
  • Coleções
  • Todos os vídeos
  • Sobre

Mais vídeos

  • Sobre
  • Código
  • Get your test results faster

    Improve your testing suite to speed up your feedback loop and get fixes in faster. Learn more about the latest improvements to testing in Xcode, including how to leverage test plans, Xcodebuild updates, and APIs to eliminate never-ending and badly-behaved tests. We'll explore Test Timeouts and Execution Time Allowances in XCTest, examine device parallelization, and detail recommended practices for balancing performance with clear fault localization.

    To get the most out of this session, you should be familiar with authoring basic tests using XCTest and managing tests through test plans. For background, watch “Testing in Xcode” from WWDC19.

    Recursos

      • Vídeo HD
      • Vídeo SD

    Vídeos relacionados

    WWDC22

    • Author fast and reliable tests for Xcode Cloud

    WWDC20

    • Handle interruptions and alerts in UI tests
    • Triage test failures with XCTIssue
    • Write tests to fail
    • XCTSkip your tests

    WWDC19

    • Getting Started with Instruments
  • Buscar neste vídeo...
    • 6:12 - testUpdatingSmoothiesFromServer Sample

      import XCTest
      @testable import Fruta
      
      class SmoothieNetworkingTests: XCTestCase {
          func testUpdatingSmoothiesFromServer() throws {
              let originalSmoothies = Smoothie.all
              try Smoothie.fetchSynchronouslyFromServer()
              XCTAssertNotEqual(originalSmoothies, Smoothie.all)
          }
      }
    • 7:56 - Interesting Spindump Content

      11  __26-[XCTestCase performTest:]_block_invoke_2 + 43 (XCTest + 167518) [0x105a70e5e] 1-11
        11  -[XCTestCase invokeTest] + 1069 (XCTest + 161187) [0x105a6f5a3] 1-11
          11  -[XCTestCase(XCTIssueHandling) _caughtUnhandledDeveloperExceptionPermittingControlFlowInterruptions:caughtInterruptionException:whileExecutingBlock:] + 183 (XCTest + 535831) [0x105acad17] 1-11
            11  __24-[XCTestCase invokeTest]_block_invoke.239 + 129 (XCTest + 162434) [0x105a6fa82] 1-11
              11  +[XCTSwiftErrorObservation observeErrorsInBlock:] + 69 (XCTest + 811868) [0x105b0e35c] 1-11
                11  __24-[XCTestCase invokeTest]_block_invoke_2 + 52 (XCTest + 162709) [0x105a6fb95] 1-11
                  11  ??? [0x7fff20438bf6] 1-11
                    11  ??? [0x7fff2043b73c] 1-11
                      11  @objc SmoothieNetworkingTests.testUpdatingSmoothiesFromServer() + 74 (<compiler-generated> in Fruta Unit Tests + 23882) [0x105d35d4a] 1-11
                        11  SmoothieNetworkingTests.testUpdatingSmoothiesFromServer() + 132 (Networking.swift:12,22 in Fruta Unit Tests + 22756) [0x105d358e4] 1-11
                          11  static Smoothie.fetchSynchronouslyFromServer() + 163 (Smoothie.swift:61,26 in Fruta + 374563) [0x10532f723] 1-11
                            11  static Smoothie.performGETRequest(to:) + 179 (Smoothie.swift:73,31 in Fruta + 375475) [0x10532fab3] 1-11
                              11  -[PKAppleAccountInformation appleID] + 6 (PassKitCore + 1577496) [0x7fff5bc14218] 1-11
                                11  -[PKNFCTagReaderSession delegate] + 8 (PassKitCore + 1348766) [0x7fff5bbdc49e] 1-11
                                 *11  psynch_mtxcontinue + 0 (pthread + 9627) [0xffffff800365a59b] (blocked by turnstile waiting for this thread) 1-11
    • 8:23 - Helper Methods

      extension Smoothie {
          
          enum Errors: Error {
              case noData
          }
          
          static var serverIsAvailable: Bool { false }
          static var smoothieEndpoint: URL {
              URL(string: "https://smoothies.food.com")!
          }
          
          static func fetchSynchronouslyFromServer() throws {
              fetchSmoothieLock.lock()
              defer { fetchSmoothieLock.unlock() }
              
              guard let data = performGETRequest(to: smoothieEndpoint) else {
                  throw Errors.noData
              }
              
              let smoothies = try JSONDecoder().decode([Smoothie].self, from: data)
              Smoothie.all += smoothies
          }
      
          static func performGETRequest(to url: URL) -> Data? {
              defer { fetchSmoothieLock.unlock() }
              
              if url == smoothieEndpoint {
                  fetchSmoothieLock.lock()
              }
              
              return performNetworkRequest(method: .get, url: url)
          }
      }
    • 8:43 - Update performGETRequest function

      extension Smoothie {
        
          // Omitted for brevity. See previous code snippet for content.
        
          static func performGETRequest(to url: URL) -> Data? {
              return performNetworkRequest(method: .get, url: url)
          }
      }

Developer Footer

  • Vídeos
  • WWDC20
  • Get your test results faster
  • Open Menu Close Menu
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store
    Open Menu Close Menu
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • Icon Composer
    • SF Symbols
    Open Menu Close Menu
    • Accessibility
    • Accessories
    • Apple Intelligence
    • Audio & Video
    • Augmented Reality
    • Business
    • Design
    • Distribution
    • Education
    • Games
    • Health & Fitness
    • In-App Purchase
    • Localization
    • Maps & Location
    • Machine Learning & AI
    • Security
    • Safari & Web
    Open Menu Close Menu
    • Documentation
    • Downloads
    • Sample Code
    • Videos
    Open Menu Close Menu
    • Help Guides & Articles
    • Contact Us
    • Forums
    • Feedback & Bug Reporting
    • System Status
    Open Menu Close Menu
    • Apple Developer
    • App Store Connect
    • Certificates, IDs, & Profiles
    • Feedback Assistant
    Open Menu Close Menu
    • 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
    Open Menu Close Menu
    • Meet with Apple
    • Apple Developer Centers
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Academies
    • WWDC
    Read the latest news.
    Get the Apple Developer app.
    Copyright © 2026 Apple Inc. All rights reserved.
    Terms of Use Privacy Policy Agreements and Guidelines