Collecting distinct evidence for iOS logic and interface changes

← Back to Blog & Articles

The unit of work is a behavior with a test that fails without it.

The durable artifact is a failing test shown before the fix. The chief hazard is a green suite that proves less than it appears to.

Trace a test: the builder produces a fixture, a double replaces the outside world, the code under test runs on the right actor, and the assertion states an outcome. Ownership is clear. The builder owns valid defaults, the double owns control of order and failure, and the test owns one behavior.

Record the baseline with swift test and the test count. Add a behavior, write its test first, and watch it fail for the right reason. Then make it pass, then remove the behavior again and confirm the failure returns.

Read the assertions first. For each, ask what outcome it protects. Then read the setup and look for sleeps, shared state, real clocks, and fixtures that set unrelated fields. Last, check the test count against the previous run.

When a test is flaky, find which of time, order, or the outside world it depends on and add the double. Never fix flakiness with a retry or a longer wait. When a test passes but the bug exists, the test asserted the wrong outcome; fix the assertion and keep the bug as a regression case.

Tests contain fixtures, and fixtures leak. Check that no real customer data, token, or key is in a test. The repository’s hygiene test scans for credential shapes and skips only the file that deliberately defines fake ones. Check that tests never reach the network.

Verify the suite itself: run it from a clean checkout, compare the count with the last accepted run, run the weakening detector between revisions, and restore each important bug in a scratch branch to confirm a test fails.

Require a failing test before a defect fix. Review tests as carefully as code, and reject tests that assert only existence. Put shared doubles in one place and name the owner.

  • Every behavior has a test that fails without it.
  • No test uses a sleep or the real clock.
  • Presentation text and symbols are tested as data.
  • The test count never drops without a reviewed reason.
  • Fixtures contain no real data.
  • Which of the three sources of flakiness does each double in the support target remove?
  • Why can coverage be high while a suite is weak?
  • What does the optimistic read in the end-to-end test protect?
  • How would you check that a new test fails without the behavior?

Continue with the book

Explore the full treatment, worked examples, and exercises in Agentic iOS App Development.


Companion article for Agentic iOS App Development, published by Choral Software. Article text and original examples © 2026 Choral Software. All rights reserved.

Scroll to Top