Edge case

Definition
An edge case is a rare or extreme situation a system might encounter that falls outside the typical, expected path most users take.

Why it matters

Each edge case is rare. Together they are common, because a product with thousands of users meets dozens of them every week. The common path builds the product, and the edge cases build trust. A customer who hits a form that silently does nothing does not think "rare situation". They think "this is unreliable". Fixing one after a support ticket costs far more than deciding in advance what should happen.

How to apply it

  • List the boundaries of each input and state: empty, zero, maximum, negative, duplicate, very long, and unusual characters.
  • Rank them by how likely they are and how much damage a bad result would do. Money, personal data and anything irreversible come first.
  • Decide the correct behaviour for each, instead of letting the system fail in whatever way was easiest to code.
  • Write an automated test for each case that matters, so a later change cannot quietly break it. See test coverage.
  • Read support tickets for cases nobody anticipated and add the worst to the list.

What it is

Most users do roughly the same thing, and software is built around that. An edge case is what happens at the boundaries. A customer with no orders yet, a surname with an apostrophe or accent, a quantity of zero, a form submitted twice by a nervous double-click, a booking at midnight across time zones, an invoice dated 29 February. Strictly, a "corner case" is two unusual conditions at once, but the two terms are used interchangeably.

When building with AI

Code generated by an AI assistant usually handles the happy path well. Ask it directly to list the edge cases of a feature and to write tests for them before accepting the result.

Worked example

Suppose a small booking form for a consultancy takes a date, a name and a number of seats. Nobody tests what happens when someone submits it twice after a nervous double-click, enters zero seats or types an apostrophe into a surname. In the first month one customer is booked twice, and another receives a confirmation with a stray character where the apostrophe should be.

The team lists the boundaries of each input and ranks them by damage. Bookings and personal data come first, so duplicate submissions are blocked and zero seats are rejected with a clear message. Each case that matters gets an automated test, so a later change cannot quietly bring the bug back. The apostrophe is handled as ordinary text, which takes an afternoon to fix.

  1. Article

    Rollback

    Protects the product when a case slips through.

  2. Article

    Feature flag

    Limits who sees a new feature while its edge cases are found.

  3. Article

    Minimum Viable Product (MVP)

    The version where many are knowingly left unhandled.

Where it shows up

  • Writing copy that feels like conversation instead of marketing. How to sound like yourself.
    12 chapters