Skip to content

Testing strategy, seams, and confidence

A testing strategy starts from product risk, not a target coverage percentage or a prescribed pyramid. Put each claim at the lowest distance that can actually prove it.

Build a risk matrix

RiskCheapest trustworthy evidenceWhy
title invariantdomain unit testno framework behavior involved
save orchestrationuse-case test with in-memory libraryproves success and failure policy
SwiftData mappingadapter contract with temporary storetranslation is the risk
deep-link wiringUI integration testframework navigation must participate
VoiceOver orderaccessibility audit and device checksemantics and interaction matter
launch budgetmeasured supported device matrixsimulator timing cannot prove device cost

Use a few long journeys for composition. Keep combinatorial rule cases near pure code where failures are fast and precise.

Design seams around uncertainty

Inject time, identifiers, network transport, persistence, and scheduling because they are variable or external. Do not create an interface for a pure function solely to mock it. A seam should lower setup cost, permit a deterministic substitute, or isolate a failure policy.

Define confidence by claims

Green tests provide confidence only for the environments and behavior they exercised. A Linux Swift test can prove standard-library domain logic. It cannot prove SwiftUI layout, UIKit lifecycle, signing, entitlements, simulator integration, or physical-device performance.

Track unverified claims beside passing evidence. That keeps missing device and account checks visible without blocking unrelated lessons.

Series navigation

References