Hands on

An online shop, four gates and four changes, from less to more risk.

Before you start, stop 2 of 5

The shop

A catalog, a cart, a payment and customer accounts, all made up. A text that goes wrong doesn't matter; a payment gateway can charge twice.

  • The constitution says two things: prices in cents and no card details stored.
  • The traffic light goes by paths: payments/, admin/ and the migrations in red, text/ in green and everything else in yellow.
  • A person approves the blueprint, and the agent can't modify it.
  • It's set up with what's already there: a repository, CI and an agent.

The four gates

GateWhat it provesWhat opens it
ScenarioThat we know what has to passWell-written scenarios, and a person who reads them if needed
TestingThat the code does what the scenarios sayTests written by a separate agent that distinguish a correct result from a faulty one
RefactoringThat the code can be maintainedLinters, Sonar, typing and a reviewer with a fresh context
ReviewingThat it's ready to go inCI and a code reviewer: a separate agent, a person or both

The four changes

ChangeColorWhat happens at the gatesIt calls you
The text of a buttonGreenThe text passes the checks that apply to it.Never
A size filterYellowIt says "done" twice without being done. A test catches a size with no results, and a reviewer, reading the change, sees that the filter gets lost on the second page.Once
The payment gatewayRedA double click charges twice. The agent touches the test so it passes, and the gate rejects it. A reviewer catches an order marked as paid with the gateway down.Twice
My ordersYellowThey all pass, and even so one person can see another's order.Twice

What "My orders" teaches

The blueprint didn't mark orders/ as delicate. None of the checks verified who could read an order.

You approve a change to the blueprint: orders/ and access control move to red, a scenario with its test stays for "each person sees only their own orders," and the reviewer takes that check on board.

Before you classify, ask what would be serious if it goes wrong.

Before you cross: In "My orders" all four gates passed. Does that mean the change was right?

Yes No

That's not it. Getting through the last gate only says it got past what we know how to check. What slipped through gets hardened.

That's it. Getting through the last gate only says it got past what we know how to check. What slipped through gets hardened.