# Testing

> Testing — Foundations Skill

- Skill: `caglarbaranbora/testing` (Agent Skill)
- Install (CLI): `npx skillmds@latest add caglarbaranbora/testing`
- Raw SKILL.md: https://api.skillmd.com/api/skills/caglarbaranbora/testing/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: caglarbaranbora (https://skillmd.com/u/caglarbaranbora)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/caglarbaranbora/testing

---


# Testing — Foundations Skill

## Purpose

Route Apple-platform testing implementation tasks to the minimum required
Knowledge Contracts. v1 scope is a curated subset of XCTest (case
structure, assertions, skipping), the newer Swift Testing framework
(`@Test`/`#expect`/`#require`/`@Suite`/`Tag`), parameterized and
`async`/`throws` test functions in both frameworks, XCUITest
(`XCUIApplication`/`XCUIElement`), and `XCTestExpectation` for
callback-based asynchronous code -- not performance testing, Test Plans,
snapshot testing, UI test recording, mocking/DI patterns, or accessibility
audits.

## Routing

Load only the contracts relevant to the task. All paths relative to
knowledge/testing/.

-   Subclassing `XCTestCase`; naming a `test`-prefixed method; overriding
    `setUp()`/`setUpWithError()`/`tearDown()`/`tearDownWithError()`; using
    `XCTAssertEqual`/`XCTAssertTrue`/`XCTAssertNil`/`XCTAssertThrowsError`/
    `XCTFail`; or skipping with `XCTSkip`/`XCTSkipIf`/`XCTSkipUnless` ->
    xctest-case-structure-and-assertions.md
-   Writing `import Testing`; declaring `@Test`; choosing between
    `#expect(_:)` and `#require(_:)`; grouping with `@Suite`; or tagging
    with `Tag`/`.tags(_:)` -> swift-testing-fundamentals.md
-   Parameterizing a `@Test` with `arguments:` over one collection, two
    collections, or `zip(...)`; or writing an `async`/`async throws` test
    function in either framework -> parameterized-and-async-tests.md
-   Launching the app under test with `XCUIApplication()`/`.launch()`;
    setting `continueAfterFailure`; querying `XCUIElement`s by
    `accessibilityIdentifier`; or asserting with `.exists`/
    `.waitForExistence(timeout:)` -> ui-testing-with-xcuiapplication.md
-   Testing a delegate callback or completion-handler API with no
    `async`/`await` entry point via `XCTestExpectation`,
    `expectation(description:)`, `.fulfill()`, or
    `await fulfillment(of:timeout:)` -> expectations-for-asynchronous-code.md

Never load more than the contracts relevant to the specific question.

## Stop Conditions

Stop and report if the requested topic has no matching Knowledge Contract
in knowledge/testing/ -- do not guess or fall back to general knowledge.
Performance testing (`measure { }`, `XCTMetric`, `XCTClockMetric`) is out
of scope entirely -- do not fabricate performance-testing guidance. Xcode
Test Plans (`.xctestplan`) and code coverage configuration are owned by
the `xcode` domain -- report the boundary rather than answer from this
skill. Snapshot testing (e.g. swift-snapshot-testing) is a third-party
pattern, not an Apple-documented API -- out of scope entirely. Xcode's UI
test recording is an IDE workflow, not an API surface -- out of scope
entirely. Mocking, dependency injection, and test-double patterns are
general software-engineering technique, not Apple-API-specific -- out of
scope entirely. `XCUIApplication().performAccessibilityAudit()` is owned
by the `accessibility` domain -- report the boundary rather than build it
here.

