<!--
{
  "availability" : [
    "Xcode: 16.0.0 -",
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "swift: 6.0.0 -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Testing",
  "identifier" : "/documentation/Testing/Trait/bug(_:id:_:)-10yf5",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Swift Testing",
      "Testing"
    ],
    "preciseIdentifier" : "s:7Testing5TraitPA2A3BugVRszrlE3bug_2id_AESSSgYt_SSYtAA7CommentVSgtFZ"
  },
  "title" : "bug(_:id:_:)"
}
-->

# bug(_:id:_:)

Constructs a bug to track with a test.

```
static func bug(_ url: String? = nil, id: String, _ title: Comment? = nil) -> Self
```

## Parameters

`url`

A URL that refers to this bug in the associated bug-tracking
system.

`id`

The unique identifier of this bug in its associated bug-tracking
system.

`title`

Optionally, the human-readable title of the bug.

## Return Value

An instance of [`Bug`](/documentation/Testing/Bug) that represents the specified bug.

---

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)