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

# bug(_:_:)

Constructs a bug to track with a test.

## Declaration

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

## Parameters

- `url`: A URL that refers to this bug in the 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(_:id:_:)](testing/trait/bug(_:id:_:)-10yf5.md)
- [bug(_:id:_:)](testing/trait/bug(_:id:_:)-3vtpl.md)
