Skillshub ios-testing

iOS Testing Best Practices

install
source · Clone the upstream repo
git clone https://github.com/ComeOnOliver/skillshub
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ComeOnOliver/skillshub "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/pproenca/dot-skills/ios-testing" ~/.claude/skills/comeonoliver-skillshub-ios-testing && rm -rf "$T"
manifest: skills/pproenca/dot-skills/ios-testing/SKILL.md
source content

iOS Testing Best Practices

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.

Clinic Architecture Contract (iOS 26 / Swift 6.2)

All guidance in this skill assumes the clinic modular MVVM-C architecture:

  • Feature modules import
    Domain
    +
    DesignSystem
    only (never
    Data
    , never sibling features)
  • App target is the convergence point and owns
    DependencyContainer
    , concrete coordinators, and Route Shell wiring
  • Domain
    stays pure Swift and defines models plus repository,
    *Coordinating
    ,
    ErrorRouting
    , and
    AppError
    contracts
  • Data
    owns SwiftData/network/sync/retry/background I/O and implements Domain protocols
  • Read/write flow defaults to stale-while-revalidate reads and optimistic queued writes
  • ViewModels call repository protocols directly (no default use-case/interactor layer)

When to Apply

Reference these guidelines when:

  • Writing new unit tests or UI tests for iOS apps
  • Designing testable architecture with dependency injection
  • Testing async/await, actors, and Combine publishers
  • Setting up snapshot testing or visual regression suites
  • Configuring CI pipelines, test plans, and parallel execution

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Test Architecture & TestabilityCRITICAL
arch-
2Unit Testing FundamentalsCRITICAL
unit-
3Test Doubles & IsolationHIGH
mock-
4Async & Concurrency TestingHIGH
async-
5SwiftUI TestingMEDIUM-HIGH
swiftui-
6UI & Acceptance TestingMEDIUM
ui-
7Snapshot & Visual TestingMEDIUM
snap-
8Test Reliability & CILOW-MEDIUM
ci-

Quick Reference

1. Test Architecture & Testability (CRITICAL)

2. Unit Testing Fundamentals (CRITICAL)

3. Test Doubles & Isolation (HIGH)

4. Async & Concurrency Testing (HIGH)

5. SwiftUI Testing (MEDIUM-HIGH)

6. UI & Acceptance Testing (MEDIUM)

7. Snapshot & Visual Testing (MEDIUM)

8. Test Reliability & CI (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information