← All phases
5

Lesson 5 — Testing & Fixing

Maps to: SYSTEM.md Phase 5 (expo-testing) Goal: leave this lesson with an app that survives normal (and not-so-normal) use without crashing.

Break your own app on purpose

Before writing a single automated test, try to break the Habit Tracker by hand:

Describing bugs precisely

If something breaks, describe it exactly like this — plain English, specific:

"Tapping the plus button on the home screen does nothing" — good, specific, enough for Claude Code to find the bug.

You do NOT need: "line 42 has a typo" or any code-level diagnosis. "The button does nothing" is the right level of detail — Claude Code will look at the code itself.

Automated testing with Maestro

This system uses Maestro for UI testing — either locally against a dev-client build, or via Maestro Cloud when you don't have local device/infra access (see SYSTEM.md Phase 5). Ask Claude Code to write a Maestro flow for the core loop:

Write a Maestro test flow for HabitTracker that: opens the app, taps "+ Add Habit", types "Drink water", saves, then taps the new habit on the home screen and confirms it shows "✓ done today".

Claude Code writes a .maestro/ flow file — a simple YAML script describing taps and assertions, not code you write by hand. Running it (maestro test .maestro/add-and-complete-habit.yaml, or via Maestro Cloud if no local device is set up) replays those exact steps automatically every time you make a change, catching regressions before you'd notice them by hand.

Deliverable

Your app survives normal use without crashing — the exact deliverable 04-workflow-course-overview.md Module 5 asks for.

Apply to your own idea

Run through the same "break it on purpose" checklist above (empty input, rapid taps, rotation, a long list) on your own app. Describe anything broken in plain English to Claude Code. Once your core flow is solid, ask for a Maestro flow test the same way, describing the exact steps a user would take.

Prompts

Maps to: courses/react-native-course/lessons/05-testing.md (SYSTEM.md Phase 5)

Step 1 — Break it by hand first (no prompt needed)

Before writing any test: tap things fast, rotate the phone, leave inputs empty, add a long list of items. Note anything that breaks.

Prompt 1 — Write a Maestro test flow

Write a Maestro test flow for {{APP_NAME}} that: {{DESCRIBE THE CORE USER FLOW STEP BY STEP — e.g. "opens the app, adds a new item, marks it done, confirms the done state shows correctly"}}

Runs locally against a dev-client build, or via Maestro Cloud if there's no local device/infra set up (see SYSTEM.md Phase 5).

Full lesson

courses/react-native-course/lessons/05-testing.md