<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "XCTest",
  "identifier" : "/documentation/XCTest/XCTIssue-swift.struct",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "XCTest"
    ],
    "preciseIdentifier" : "s:6XCTest8XCTIssueV"
  },
  "title" : "XCTIssue"
}
-->

# XCTIssue

An object that represents a test failure, and includes source code call stacks for test reporting and investigation.

```
struct XCTIssue
```

## Topics

### Initializers

### Issue Types

[`XCTIssue.IssueType`](/documentation/XCTest/XCTIssue-swift.struct/IssueType)

Constants that indicate types of test failures, such as assertion failures, performance regressions, or thrown errors.

### Issue Details

[`type`](/documentation/XCTest/XCTIssue-swift.struct/type)

A value for classifying an issue that occurs during testing.

[`compactDescription`](/documentation/XCTest/XCTIssue-swift.struct/compactDescription)

A concise description of the issue with no transient data, suitable for use in test run summaries and results aggregation across multiple test runs.

[`detailedDescription`](/documentation/XCTest/XCTIssue-swift.struct/detailedDescription)

A detailed description of the issue that may include transient data, such as numbers, object identifiers, and timestamps, to help diagnose the issue.

[`sourceCodeContext`](/documentation/XCTest/XCTIssue-swift.struct/sourceCodeContext)

The source code location for the issue, including the filename, line number, and call stack.

[`associatedError`](/documentation/XCTest/XCTIssue-swift.struct/associatedError)

An optional error to associate with a test issue.

[`attachments`](/documentation/XCTest/XCTIssue-swift.struct/attachments)

An array of data that augments an issue, such as files, images, screenshots, data blobs, or ZIP files.

[`add(_:)`](/documentation/XCTest/XCTIssue-swift.struct/add(_:))

Adds supporting data to an issue.

### Comparisons



---

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)