Browse Mobile App Development Section 8: Testing

Test-Driven Development for a Feature

3 fill-in slots · from The AI Prompt Handbook for Mobile App Development

Your details

0/3 filled

Test-Driven Development for a Feature

Background: Native [platform] app, [SwiftUI+Combine / Compose]. The
feature to build: [describe the behavior and acceptance criteria].

Use case: Build this feature test-first—specify behavior as tests, then
implement until they pass.

Implementation details:
- Start from the acceptance criteria; turn each into a failing test
- Work outside-in: the logic/view-model tests first, implementation
  after; keep each red→green→refactor cycle small
- Mock collaborators that don't exist yet behind interfaces
- Include edge cases and error paths as tests up front
- Don't write production code without a failing test that demands it

Layer & dependencies: Drive the design through tests so the seams (DI,
interfaces) fall out naturally—matching Sections 2–3.

Deliverable: The ordered list of tests (each as a behavior spec), the
implementation that makes them pass step by step, and the final refactor
pass—presented as the red/green/refactor sequence.

Highlighted [slots] are still empty. Downloads are plain .txt — paste into any AI assistant.