- Use XCTest for unit and integration tests, XCUITest for UI flows.
- Name tests with Given-When-Then pattern: `test[Action]_[Condition]_[ExpectedResult]`.
- Structure tests as arrange-act-assert with Given/When/Then comments.
- Inject mocks via protocols into SUT (e.g., ViewModels) in `setUp()`.
- Use `async throws` for tests matching production async code.
- Test domain logic including validation, calculations, and state transitions for isolation.
- Initialize SUT and mocks in `@MainActor setUp()` for SwiftUI compatibility.
- Aim for 80% line coverage on Core and Services layers as a quality guide, not a goal.
- Use assertions like `XCTAssertTrue`, `XCTAssertNil` to verify outcomes precisely.
- Focus on core scenarios first to build confidence before expanding coverage.