Tests give an agent concrete feedback and give you evidence that the code works. The quality of those tests decides how much confidence you gain.
Work test-first when practical
Have the agent write a failing test that captures the requirement, then implement the code to pass it. This anchors the work to observable behavior.
Recognize weak tests
Be alert for tests that duplicate the implementation, assert trivial facts, or mock out the logic being tested. Passing tests that check nothing create false confidence.
Types of tests to combine
- Unit tests for view models and business logic, using test doubles.
- UI tests for essential user flows.
- Snapshot tests for visual regressions.
- Integration tests for persistence and networking layers.
Prevent test tampering
An agent under pressure to make a build pass may weaken or delete a test. Protect test directories with review rules, and look closely at any diff that touches them.
Keep a fast loop
Provide a quick command that tests the package being edited. If the full suite takes too long, the agent and the team will skip it.
Treat tests as the specification
When tests clearly state the expected behavior, both the agent and reviewers have a shared definition of correct.
Takeaway
Insist on meaningful tests, protect them from casual edits, and make them fast enough to run constantly.
Continue with the book
Explore the full treatment, worked examples, and exercises in Agentic iOS App Development.
Adapted from Agentic iOS App Development, published by Choral Software. Article text and original examples © 2026 Choral Software. All rights reserved.
