<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "Testing",
  "identifier" : "/documentation/Testing",
  "metadataVersion" : "0.1.0",
  "role" : "Framework",
  "symbol" : {
    "kind" : "Framework",
    "modules" : [
      "Swift Testing"
    ],
    "preciseIdentifier" : "Testing"
  },
  "title" : "Swift Testing"
}
-->

# Swift Testing

Create and run tests for your Swift packages and Xcode projects.

## Overview

![The Swift logo on a blue gradient background that contains function, number, tag, and checkmark diamond symbols.](images/org.swift.testing/swift-testing-hero@2x.png)

With Swift Testing you leverage powerful and expressive capabilities of
the Swift programming language to develop tests with more confidence and less
code. The library integrates seamlessly with Swift Package Manager testing
workflow, supports flexible test organization, customizable metadata, and
scalable test execution.

- Define test functions almost anywhere with a single attribute.
- Group related tests into hierarchies using Swift’s type system.
- Integrate seamlessly with Swift concurrency.
- Parameterize test functions across wide ranges of inputs.
- Enable tests dynamically depending
  on runtime conditions.
- Parallelize tests in-process.
- Categorize tests using tags.
- Associate bugs directly with the tests that verify their fixes or reproduce
  their problems.

#### Related videos

- [Meet Swift Testing](https://developer.apple.com/videos/play/wwdc2024/10179)
- [Go further with Swift Testing](https://developer.apple.com/videos/play/wwdc2024/10195)

## Topics

### Essentials

[Defining test functions](/documentation/Testing/DefiningTests)

Define a test function to validate that code is working correctly.

[Organizing test functions with suite types](/documentation/Testing/OrganizingTests)

Organize tests into test suites.

[Migrating a test from XCTest](/documentation/Testing/MigratingFromXCTest)

Migrate an existing test method or test class written using XCTest.

[`Test(_:_:)`](/documentation/Testing/Test(_:_:))

Declare a test.

[`Test`](/documentation/Testing/Test)

A type representing a test or suite.

[`Suite(_:_:)`](/documentation/Testing/Suite(_:_:))

Declare a test suite.

### Test parameterization

[Implementing parameterized tests](/documentation/Testing/ParameterizedTesting)

Specify different input parameters to generate multiple test cases from a test function.

[`Test(_:_:arguments:)`](/documentation/Testing/Test(_:_:arguments:)-8kn7a)

Declare a test parameterized over a collection of values.

[`Test(_:_:arguments:_:)`](/documentation/Testing/Test(_:_:arguments:_:))

Declare a test parameterized over two collections of values.

[`Test(_:_:arguments:)`](/documentation/Testing/Test(_:_:arguments:)-3rzok)

Declare a test parameterized over two zipped collections of values.

[`CustomTestArgumentEncodable`](/documentation/Testing/CustomTestArgumentEncodable)

A protocol for customizing how arguments passed to parameterized tests are
encoded, which is used to match against when running specific arguments.



<!-- - ``Test/Parameter`` -->

[`Test.Case`](/documentation/Testing/Test/Case)

A single test case from a parameterized [`Test`](/documentation/Testing/Test).

### Behavior validation

[Expectations and confirmations](/documentation/Testing/Expectations)

Check for expected values, outcomes, and asynchronous events in tests.

[Known issues](/documentation/Testing/known-issues)

Mark issues as known when running tests.

### Test customization

[Traits](/documentation/Testing/Traits)

Annotate test functions and suites, and customize their behavior.

### Data collection

[Attachments](/documentation/Testing/Attachments)

Attach values to tests to help diagnose issues and gather feedback.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)
