<!--
{
  "availability" : [
    "Xcode: 16.0.0 -",
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "swift: 6.0.0 -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Testing",
  "identifier" : "/documentation/Testing/Bug",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Swift Testing"
    ],
    "preciseIdentifier" : "s:7Testing3BugV"
  },
  "title" : "Bug"
}
-->

# Bug

A type that represents a bug report tracked by a test.

```
struct Bug
```

## Overview

To add this trait to a test, use one of the following functions:

- [`bug(_:_:)`](/documentation/Testing/Trait/bug(_:_:))
- [`bug(_:id:_:)`](/documentation/Testing/Trait/bug(_:id:_:)-10yf5)
- [`bug(_:id:_:)`](/documentation/Testing/Trait/bug(_:id:_:)-3vtpl)

---

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)