Skip to content

Conversation

@vnsamy-code
Copy link

Swift Reporter - Proposal

Adds ADR-009 proposing Swift reporter implementation for TDD Guard. The reporter will support iOS, macOS, watchOS, and tvOS platforms (All Apple Platforms).

Key decisions:

XCTestObservation

  • Phase 1: XCTest support via XCTestObservation protocol
    • Official Apple API with stable 10+ year protocol contracts
    • Rich structured data (file paths, line numbers, error messages)
    • No fragile text parsing required
    • Evidence of strong contract over the years.

Swift Testing

  • Phase 2: Swift Testing support via XUnit XML parsing
    • In it's infancy. New test system (under 2 years).
    • Stable, documented format (industry standard)
    • Note: swift test lacks JSON output (unlike Go/Rust)
    • Tradeoff accepted: missing file/line numbers for stability, potential xml contract violation between versions.

The reporter follows Go/Rust patterns:

  • Writes to .claude/tdd-guard/data/test.json
  • Recognizes compilation errors as valid RED-phase failures
  • Distributed as Swift Package with executable product

Adds ADR-009 proposing Swift reporter implementation for TDD Guard.
The reporter will support iOS, macOS, watchOS, and tvOS platforms.

Key decisions:
- Phase 1: XCTest support via XCTestObservation protocol
  - Official Apple API with stable 10+ year protocol contracts
  - Rich structured data (file paths, line numbers, error messages)
  - No fragile text parsing required
- Phase 2: Swift Testing support via XUnit XML parsing
  - Stable, documented format (industry standard)
  - Note: swift test lacks JSON output (unlike Go/Rust)
  - Tradeoff accepted: missing file/line numbers for stability

The reporter follows Go/Rust patterns:
- Writes to .claude/tdd-guard/data/test.json
- Recognizes compilation errors as valid RED-phase failures
- Distributed as Swift Package with executable product

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant