---
title: "bug(_:id:_:)"
framework: testing
role: symbol
role_heading: Type Method
path: "testing/trait/bug(_:id:_:)-10yf5"
---

# bug(_:id:_:)

Constructs a bug to track with a test.

## Declaration

```swift
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.

## Mentioned in

Associating bugs with tests Interpreting bug identifiers Enabling and disabling tests

## Return Value

Return Value An instance of Bug that represents the specified bug.

## See Also

### Annotating tests

- [Adding tags to tests](testing/addingtags.md)
- [Adding comments to tests](testing/addingcomments.md)
- [Associating bugs with tests](testing/associatingbugs.md)
- [Interpreting bug identifiers](testing/bugidentifiers.md)
- [Tag()](testing/tag().md)
- [bug(_:_:)](testing/trait/bug(_:_:).md)
- [bug(_:id:_:)](testing/trait/bug(_:id:_:)-3vtpl.md)
