Happy path / edge case
The happy path is the run where everything works. Edge cases are the boundary runs: empty, huge, expired, duplicated, weirdly shaped.
See it
What it is
The happy path is the run where the user does the expected thing and every system cooperates: valid input, fast network, results found, payment approved. Everything else splits into two piles that get confused constantly. Alternate and error paths are ordinary and expected: the card is declined, the search finds nothing, the user cancels, the invite is already pending. Edge cases are the unusual ones out at the boundaries and extremes: zero rows, ten thousand rows, a 200-character company name, a token that expires mid-request. The demo you record lives on the happy path; the support tickets live everywhere else.
The productive move is to enumerate the edges by category instead of waiting to discover them. Zero (empty list, no results, first run), one, and many (a thousand rows, pagination, a name that wraps four lines). Extremes (a 200-character company name, a 40MB upload, an emoji-only search). Time (expired token, timezone rollover, a request that lands after the user navigated away). Permissions, offline, duplicate submit, and the double-click that fires the mutation twice.
Two traps. First, edge cases are not rare in aggregate: individually a 1 percent case, together they are most of your one-star reviews. Second, AI tools ship the happy path by default, so a generated feature usually renders beautifully with three seeded rows and falls apart on zero rows or a failed fetch. Name the edges in the prompt or you will find them in production.
Ask AI for it
Before writing code, enumerate the alternate paths, error paths, and edge cases for [feature] alongside the happy path, then implement all of them. Cover at minimum: zero state (empty list, no search results, first-time user), one item, and many items (long lists needing pagination or virtualization); extreme values (very long strings, huge files, unicode and emoji, negative or zero numbers); failure states (offline, timeout, 4xx, 5xx, partial data); timing (expired session, stale response arriving after navigation, double-click submitting twice); and permissions (read-only user, unauthorized, deleted resource). Return a checklist of the cases with the exact UI shown for each, then the implementation. Do not leave any case rendering a blank screen.