ios-testing-strategy
Skill14 starsChanged 4 months agoMITView on GitHub
Use this skill when designing, reviewing, or improving automated tests for an iOS feature or codebase, including test boundaries, system-wide tests, test doubles, coverage priorities, volatile code, TDD, and test maintenance. Do not use it for general XCTest or Swift Testing syntax unless the task also involves testing strategy or architecture.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- apexbymanish/claude-ai-agents-iostheir own version, first seen Oct 9, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- apexbymanish/claude-ai-agents-ios★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. About 0 are common, 23 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈23
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this skill to choose high-value test boundaries, protect meaningful behavior, and avoid test suites that are slow, fragile, or coupled …
- Distinctive: line 14
Use this skill when the task involves:
- Distinctive: line 28
Do not use this skill for:
- Distinctive: line 40
Keep real deterministic domain and application components connected.
- Distinctive: line 51
Test meaningful behavior rather than every type in isolation.
- Distinctive: line 52
Prefer a broader test when several components jointly implement one behavior or mocks would reproduce most of their collaboration.
- Distinctive: line 53
Prefer a narrower test for algorithms, combinatorial cases, or logic that needs many fast examples.
- Distinctive: line 54
Do not equate XCTest or Swift Testing with testing one class.
- Distinctive: line 59
Prefer real implementations for deterministic, lightweight components whose collaboration is part of the behavior.
- Distinctive: line 60
Prefer in-memory stores or repositories when they preserve useful behavior without external cost.
- Distinctive: line 61
Use a fake, stub, spy, or mock for networking, storage, clocks, randomness, system APIs, external SDKs, or other unstable boundaries.
- Distinctive: line 62
Use interaction assertions only when the interaction itself is part of the contract.
- Distinctive: line 63
Do not introduce a protocol solely because a type appears in a test.
- Distinctive: line 82
Treat coverage as a diagnostic signal, not the objective.
- Distinctive: line 87
Add broader regression tests as behavior and boundaries stabilize.
- Distinctive: line 88
Use TDD when requirements and outcomes are clear enough for tests to guide design.
- Distinctive: line 89
Do not prescribe TDD for exploratory UI work, architectural spikes, or rapidly changing product flows.
- Distinctive: line 95
Avoid assertions about private methods, incidental call order, exact object graphs, or temporary decomposition.
- Distinctive: line 96
Keep setup close to the behavior under test.
- Distinctive: line 98
Keep fixtures minimal and scenario-specific.
- Distinctive: line 113
When reviewing a testing strategy, respond with:
- Distinctive: line 122
When reviewing existing tests, also identify implementation coupling, unnecessary doubles, missing high-risk scenarios, duplicated setup, …
- Distinctive: line 126
Read these only when relevant:
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
iOS Testing Strategy
Purpose
Use this skill to choose high-value test boundaries, protect meaningful behavior, and avoid test suites that are slow, fragile, or coupled to implementation details.
When to use this skill
Use this skill when the task involves:
- deciding what to test and at which level;
- unit, integration, system-wide, or cross-domain tests;
- excessive mocks, stubs, spies, protocols, or test-only abstractions;
- brittle tests that break during refactoring;
- coverage priorities or uneven test coverage;
- prototypes, volatile features, or rapidly changing architecture;
- choosing whether to use TDD;
- reducing setup, fixtures, boilerplate, flakiness, or execution time;
- choosing between automated and manual verification.
When not to use this skill
Do not use this skill for:
- testing framework syntax with no strategy question;
- UI automation mechanics with no architectural concern;
- performance profiling;
- debugging a defect unless the task also asks how to prevent regression.
Core workflow
- Define the behavior, invariant, or failure risk that needs protection.
- Identify a stable entry point through which the behavior can be exercised.
- Choose the broadest boundary that remains fast, deterministic, and diagnosable.
- Keep real deterministic domain and application components connected.
- Replace only slow, destructive, nondeterministic, or externally controlled boundaries.
- Assert observable outputs, state, persisted data, emitted effects, or user-visible outcomes.
- Evaluate execution time, diagnostic value, flakiness, setup cost, and expected maintenance.
- Recommend the smallest suite that provides sufficient confidence.
- State whether the test belongs in local feedback, pull-request validation, or a slower CI suite.
Decision rules
Test boundaries
- Test meaningful behavior rather than every type in isolation.
- Prefer a broader test when several components jointly implement one behavior or mocks would reproduce most of their collaboration.
- Prefer a narrower test for algorithms, combinatorial cases, or logic that needs many fast examples.
- Do not equate XCTest or Swift Testing with testing one class; a unit-test target can exercise a complete feature slice.
- Reject a broad test when it becomes slow, flaky, or too difficult to diagnose.
Real dependencies and test doubles
- Prefer real implementations for deterministic, lightweight components whose collaboration is part of the behavior.
- Prefer in-memory stores or repositories when they preserve useful behavior without external cost.
- Use a fake, stub, spy, or mock for networking, storage, clocks, randomness, system APIs, external SDKs, or other unstable boundaries.
- Use interaction assertions only when the interaction itself is part of the contract.
- Do not introduce a protocol solely because a type appears in a test.
Prioritization
Prioritize:
- business-critical, security-sensitive, financial, authentication, authorization, migration, and data-loss risks;
- complex calculations and state transitions;
- behavior with a history of regressions;
- scenarios that are slow, repetitive, or unreliable to verify manually;
- stable invariants inside otherwise volatile features.
Deprioritize:
- disposable prototypes and temporary adapters;
- rapidly changing UI composition;
- implementation details likely to be rewritten;
- trivial forwarding code already covered by a broader scenario.
Treat coverage as a diagnostic signal, not the objective. Allocate testing effort by risk, volatility, and maintenance cost rather than uniformly across modules.
Volatile code and TDD
- During exploration, protect critical invariants and risky algorithms without freezing temporary structure.
- Add broader regression tests as behavior and boundaries stabilize.
- Use TDD when requirements and outcomes are clear enough for tests to guide design.
- Do not prescribe TDD for exploratory UI work, architectural spikes, or rapidly changing product flows.
- Defer a test only when the accepted risk and alternative validation are explicit.
Assertions and maintainability
- Assert returned values, observable state, persisted data, emitted effects, meaningful errors, and recovery behavior.
- Avoid assertions about private methods, incidental call order, exact object graphs, or temporary decomposition.
- Keep setup close to the behavior under test.
- Extract helpers only when they reduce repetition without hiding intent.
- Keep fixtures minimal and scenario-specific.
- Split slow suites from fast feedback tests rather than weakening all tests.
Gotchas
- Extensive mocking may indicate that the test boundary is too narrow.
- A broad test is not automatically better if failures are difficult to localize.
- Real databases, clocks, networks, and system services can introduce flakiness.
- Tests coupled to internal calls may block safe refactoring without protecting behavior.
- High coverage can coexist with missing critical scenarios.
- Rapid delivery is not itself a reason to skip tests; make the accepted risk explicit.
- A test suite developers rarely run provides limited feedback value.
Output expectations
When reviewing a testing strategy, respond with:
- The behavior or risk that should be protected.
- The recommended test boundary and why.
- Which dependencies should remain real and which should be replaced.
- The key scenarios and observable assertions.
- Trade-offs, maintenance risks, and exceptions.
- How and where the tests should run.
When reviewing existing tests, also identify implementation coupling, unnecessary doubles, missing high-risk scenarios, duplicated setup, slow or flaky boundaries, and tests that should be removed, widened, or narrowed.
References
Read these only when relevant:
references/test-boundaries.md— read when choosing between narrow unit tests, feature-level tests, integration tests, and system-wide tests.references/test-doubles-and-real-dependencies.md— read when choosing real implementations, in-memory components, fakes, stubs, spies, mocks, or protocols.references/risk-based-test-prioritization.md— read when deciding what to test first, how deeply to test it, or how to distribute effort across domains.references/volatile-code-and-tdd.md— read when testing prototypes, unstable features, architectural spikes, or deciding whether TDD is appropriate.references/assertions-and-refactoring-resilience.md— read when tests depend on private methods, call order, interaction counts, or other implementation details.references/test-suite-maintainability.md— read when reducing fixtures, setup, boilerplate, execution time, flakiness, or CI feedback time.references/coverage-and-manual-testing.md— read when discussing coverage targets, automation gaps, or the trade-off between automated and manual verification.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

