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

# Comment

A type that represents a comment related to a test.

```
struct Comment
```

## Overview

Use this type to provide context or background information about a
test’s purpose, explain how a complex test operates, or include details
which may be helpful when diagnosing issues recorded by a test.

To add a comment to a test or suite, add a code comment before its `@Test`
or `@Suite` attribute. See [Adding comments to tests](/documentation/Testing/AddingComments) for more details.

> Note: To reference bugs related to a test, use ``doc://org.swift.testing/documentation/Testing/Trait/bug(_:_:)``,
> ``doc://org.swift.testing/documentation/Testing/Trait/bug(_:id:_:)-10yf5``, or ``doc://org.swift.testing/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)