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:
- Tap "Save" on the add-habit screen with the text field empty. (The code from Lesson 4 already guards this —
if (name.trim().length === 0) return;— confirm nothing happens instead of crashing.) - Tap a habit's row rapidly, many times in a row. (Nothing should change after the first tap today — confirm the streak doesn't jump by more than 1.)
- Rotate your phone while the add-habit screen is open. (The layout should still be usable, even if not perfectly centered.)
- Add 20+ habits in a row. (The list should scroll, not overflow off-screen.)
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.