# Hands on

> Prepare the gates of an online shop and review four changes from less to more risk, up to the one that slips through. Nothing to install.

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

| Gate | What it proves | What opens it |
| --- | --- | --- |
| Scenario | That we know what has to pass | Well-written scenarios, and a person who reads them if needed |
| Testing | That the code does what the scenarios say | Tests written by a separate agent that distinguish a correct result from a faulty one |
| Refactoring | That the code can be maintained | Linters, Sonar, typing and a reviewer with a fresh context |
| Reviewing | That it's ready to go in | CI and a code reviewer: a separate agent, a person or both |

## The four changes

| Change | Color | What happens at the gates | It calls you |
| --- | --- | --- | --- |
| The text of a button | Green | The text passes the checks that apply to it. | Never |
| A size filter | Yellow | It 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 gateway | Red | A 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 orders | Yellow | They 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 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.

[Next: The pieces and the roles](https://gate-driven.dev/en/docs/the-pieces/index.html.md) [Go on without answering](https://gate-driven.dev/en/docs/the-pieces/index.html.md) [Index](https://gate-driven.dev/en/docs/index.html.md)
