Skip to content

The test I want to see after the happy path passes

Kevin Kissi

Kevin Kissi

· 2 min read
An electronics workbench with measurement equipment and a circuit board.
Photo by Axel Richter on Unsplash (opens in a new tab)

A customer uploads a document and gets a message saying the upload succeeded. The test passes. Now disconnect the customer just after the server has received the file and before the browser has received the acknowledgment. The customer comes back to the same screen. What should they see? How many copies of the document should the system eventually store?

I like this example because the first test is entirely legitimate. We should know that a normal upload works. The second test asks something different about the service. It asks whether the account and the customer’s understanding of the account can recover from a perfectly ordinary interruption.

The upload succeeded on the server. A test that interrupts the acknowledgment can reveal duplicate records or a misleading customer state.
A test that interrupts the acknowledgment can reveal duplicate records or a misleading customer state. Original explanatory figure.
Read the figure as text
Document written
The server has accepted and stored the file.
Response arrives
The browser can show a confirmed upload.
Response is lost
A retry must reconcile with the existing write.

Find a change that would alter the answer

A useful exploration starts with a prediction. Given a completed server write and a lost acknowledgment, a retry should either recover the existing document or make any duplicate explicit according to the product’s rules. The team has to choose its intended behavior before it can claim the retry worked.

An automated system can help find this case. It can map the steps, identify a boundary between a lasting side effect and a visible confirmation, and propose an interruption at that boundary. It can then inspect both the customer-facing list and the underlying document record. Those observations give a reviewer something more useful than a replay of a spinning upload icon.

This is the distinction I have in mind when I talk about continuous validation. Repeating a successful execution on every commit is worthwhile. Exploring which assumptions a change might invalidate is a different capability. When generated code arrives rapidly, teams need both, and they need a way to tell which work has actually been done.

The customer who sees a retry button is making a reasonable decision with limited information. If our test strategy assumes they already know what happened on the server, we have tested a customer who doesn’t exist. Before I call that upload reliable, I want to see what happens to the one who lost the acknowledgment.

Kevin Kissi

About Kevin Kissi

Engineering Leader

Subscribe

Stay up to date with my newest posts