Guides testing practices for iOS 26 / Swift 6.2 modular MVVM-C apps. Covers unit, UI, snapshot testing, protocol mocks, async actor isolation, and dependency-injected architecture.
How this skill is triggered — by the user, by Claude, or both
Slash command
/pproenca-dot-skills-1:ios-testingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Comprehensive testing guide for iOS and Swift applications, written at principal engineer level. Contains 44 rules across 8 categories, prioritized by impact to guide test architecture decisions, test authoring patterns, and CI infrastructure.
Comprehensive testing guide for iOS and Swift applications, written at principal engineer level. Contains 44 rules across 8 categories, prioritized by impact to guide test architecture decisions, test authoring patterns, and CI infrastructure.
All guidance in this skill assumes the clinic modular MVVM-C architecture:
Domain + DesignSystem only (never Data, never sibling features)DependencyContainer, concrete coordinators, and Route Shell wiringDomain stays pure Swift and defines models plus repository, *Coordinating, ErrorRouting, and AppError contractsData owns SwiftData/network/sync/retry/background I/O and implements Domain protocolsReference these guidelines when:
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Test Architecture & Testability | CRITICAL | arch- |
| 2 | Unit Testing Fundamentals | CRITICAL | unit- |
| 3 | Test Doubles & Isolation | HIGH | mock- |
| 4 | Async & Concurrency Testing | HIGH | async- |
| 5 | SwiftUI Testing | MEDIUM-HIGH | swiftui- |
| 6 | UI & Acceptance Testing | MEDIUM | ui- |
| 7 | Snapshot & Visual Testing | MEDIUM | snap- |
| 8 | Test Reliability & CI | LOW-MEDIUM | ci- |
arch-protocol-dependencies - Depend on protocols, not concrete typesarch-constructor-injection - Use constructor injection over service locatorsarch-test-target-separation - Separate unit and UI test targetsarch-testable-import - Use @testable import sparinglyarch-single-responsibility-tests - One assertion concept per testarch-arrange-act-assert - Structure tests as Arrange-Act-Assertunit-swift-testing-framework - Use Swift Testing over XCTest for new testsunit-parameterized-tests - Use parameterized tests for input variationsunit-descriptive-test-names - Name tests after the behavior they verifyunit-expect-over-assert - Use #expect and #require over XCTAssertunit-require-preconditions - Use #require for test preconditionsunit-test-suites - Organize related tests into suitesunit-test-tags - Use tags to categorize cross-cutting testsmock-protocol-based-mocks - Create mocks from protocols, not subclassesmock-spy-for-verification - Use spies to verify interactionsmock-stub-return-values - Use stubs for deterministic return valuesmock-avoid-over-mocking - Avoid mocking value types and simple logicmock-fake-for-integration - Use in-memory fakes for integration testsmock-dependency-container - Use a dependency container for test configurationasync-await-directly - Await async functions directly in testsasync-confirmation - Use confirmation() for callback-based APIsasync-mainactor-isolation - Test MainActor-isolated code on MainActorasync-actor-testing - Test actor state through async interfaceasync-task-cancellation - Test task cancellation paths explicitlyswiftui-test-observable-models - Test @Observable models as plain objectsswiftui-environment-injection - Inject environment dependencies for testsswiftui-preview-as-test - Use previews as visual smoke testsswiftui-view-model-extraction - Extract logic from views into testable modelsswiftui-binding-testing - Test binding behavior with @Bindableui-accessibility-identifiers - Use accessibility identifiers for element queriesui-page-object-pattern - Encapsulate screens in page objectsui-launch-arguments - Configure test state via launch argumentsui-wait-for-elements - Wait for elements instead of using sleep()ui-test-user-journeys - Test complete user journeys, not individual screensui-reset-state-between-tests - Reset app state between UI testssnap-swift-snapshot-testing - Use swift-snapshot-testing for visual regressionsnap-device-matrix - Snapshot across device sizes and traitssnap-named-references - Use named snapshot references for claritysnap-inline-snapshots - Use inline snapshots for non-image assertionsci-test-plans - Use Xcode Test Plans for environment configurationsci-parallel-execution - Enable parallel test executionci-flaky-test-quarantine - Quarantine flaky tests instead of disabling themci-deterministic-test-data - Use deterministic test data over random generationci-coverage-thresholds - Set coverage thresholds for critical pathsRead individual reference files for detailed explanations and code examples:
| File | Description |
|---|---|
| references/_sections.md | Category definitions and ordering |
| assets/templates/_template.md | Template for new rules |
| metadata.json | Version and reference information |
npx claudepluginhub pproenca/dot-skillsProvides XCTest patterns for unit tests, UI tests, mocks, async/await testing, and property testing in Swift/SwiftUI iOS apps.
Provides API reference for Apple's Swift Testing framework: @Test/@Suite functions, #expect/#require assertions, traits, parameterized tests, and XCTest migration. For iOS 18+ apps.
Guides writing, modifying, and reviewing tests for iOS/macOS apps: Swift Testing, XCTest, XCUITest, performance tests, and Instruments .trace file analysis.