The edge cases are the spec

A short list of questions to ask before you call a feature done

The happy path is the part everyone already agrees on. What the software does with nothing, with too much and with the unexpected is what users actually meet.

When a feature "works", it usually means it works for the example someone had in mind. The rest of the behaviour was never decided, so the code decided it by accident.

A checklist that finds most of them

  • Nothing: an empty list, an empty string, no permission, no network. What does the screen say?
  • One: the singular case that plural wording and layouts get wrong.
  • Many: a thousand rows, a name that is eighty characters long, a table wider than the screen.
  • Slow: the request that takes ten seconds. Is there a loading state, and can it be cancelled?
  • Twice: a double click, a retried request, two tabs open. Is the action safe to repeat?
  • Wrong: input in another language, another direction, another time zone, or not what the form expected.
  • Gone: the item deleted while someone is looking at it.
  • Decide on purpose

    For each case, someone chooses the behaviour. Sometimes the choice is "show a message", sometimes "refuse", sometimes "cannot happen, and here is why". Writing the choice down turns an accident into a decision a test can hold.

    Turn each into a test

    A test for the empty case, the long case and the repeated case costs a few lines each and pays back the first time someone changes the code. The edge cases are the ones that regress, because nobody is looking at them when the code changes.

    The user's side of it

    People rarely see the happy path twice. They see the state after something went wrong, or the form with unusual data. How the product behaves there is how it feels.

    Lessons

  • Walk the checklist before calling something done.
  • Choose the behaviour for each case on purpose.
  • Pin each choice with a small test.
  • Judge the work by its worst reasonable moment, not its best.
  • Tagged: testing, quality, process

    Area: Thoughts

    Related notes

    עברית