Rehearse the Design
Chapters
- Do the rules hold?
- Is this release safe on real data?
- The complete brief
Transcript
Do the rules hold?
Before anything is deployed, we can run the modules on their own. No canister, no upgrade. Just commands going in and answers coming out. Each row of a simulation says three things: the command, the answer we expect, and what must still be true afterward. Run it. Loan seven goes out. The same member asks again and is refused. A ladder that is out is refused. Loan five comes back, and now the ladder can go. And a branch with tools out will not close. After every single command, all four rules are checked. Look at how many of these rows are refusals. That is deliberate. The ordinary path rarely hides a mistake. The edges do. And rule four checks the thing we asked for in lesson one: a refusal changes nothing. Once the hand-written rows pass, ask for a long random run under the same rules. A simulation answers one question: are the rules right? It is fast, and it sets the day itself, because the day is an argument. It says nothing about an upgrade. For that we need a real canister with a real old release in it.
Is this release safe on real data?
A rehearsal starts where production is. Install the old release, the real build. Fill it through its public methods: two branches, three tools, five loans. Then write down what is there. These values are the test. Now attempt every upgrade that could happen, in order. A build that forgot to name its predecessor: refused, values equal. A build that fails late: rolled back, values equal. The real release three: converted, and every old value is there with the new field beside it. Then the old build again: refused, nothing lost. Then release three once more, over itself: accepted, values equal. Five attempts. Each one has a before, an after, and an expected difference. Four of the five expect no difference at all. One more step, and it is the one people skip. After the upgrade, use the app. Lend a tool. Take one back. Record a condition. Old data read correctly is half of it. New writes on top of old data is the other half.
The complete brief
This is what you hand over. The modules and what each one saves. Who owns whom, and who calls whom. A bound on every collection. What each storage choice must promise. The files that are frozen. When the app is ready to upgrade. The scenario, and the rehearsal. You did not write a line of the code. You decided everything that the code must be.