Calculus of interfaces · part 2

Every tap, checked

A real invoice form, and the same form written as a function: state in, one tap or server reply or clock tick in, state out. Because it is a function, this page can visit every state the form can reach, in every order, with replies late, failed or out of order, and check eight promises a client relies on. When one breaks, you get the shortest way to break it, played in the real form.

Visiting every state…

1. The real form

Ordinary DOM code with an ordinary async send. Use it as a client would. The panel plays the billing server and the clock, so you decide when each reply arrives, and in what order. After every step the page reads the form back and compares it with the function.

Design and network

Design
Waiting sends
Clock
Start over

The real form · Shipped

    2. Eight promises, checked in every state

    Starting from a blank form, the page tries all 21 events (8 taps and key presses, 6 typed values, 6 server replies, the 15 s clock) in every state it finds, until no new state appears. Any sequence of events, however long, ends in one of these states, so a promise that holds in all of them holds for every sequence.

    What the three designs change

    3. Replay a broken promise

    The shortest way to break a promise, played step by step with real clicks, typing and key presses in a fresh copy of the real form. Play the same steps on another design to see the fix hold.

    Replay

    Broken promise
    Play on
    Play

      The real form · Draft

      4. Every state, drawn

      One dot per state the design can reach. Left to right: the fewest events from a blank form. Tap a dot to read that state and to replay the shortest way there.

      Map

      Design
      blank form

      Tap a dot.

      5. Is the check fooling itself?

      A promise list that always says "kept" proves nothing. These checks run the real form against the function, show that a wrong function gets caught, and change the Shipped design one line at a time to see which changes the promises catch.

      Takes a few seconds on a laptop, longer on a phone. The model-only checks below already ran.

      One-line changes to Shipped

      Room for waiting sends

      The search allows at most a set number of sends waiting at once. Here is what changes as that room grows.

      6. What this covers, and what it does not

      Where the ideas come from