**The brief.** `RoundTo(value, digits)` just calls .NET's `Math.Round`. Simple — so you already know the answers, right? **Predict all eight outputs, then press Run.** Every ✗ is a place the code did something you did not expect. That gap is the whole point.
This is Module 1's discipline in miniature: before you trust code — or change it — pin what it actually does. When you write down what the code really does as a check that runs, you are writing a characterization test — a spec that records the code's true behaviour so you would notice the day it changes. It is the exact move you will make on real legacy code in Module 4 — Refactoring.
The rules
- The
RoundTofunction is fixed, and so are the inputs (Value,Digits). Only your predictions move. - The
Predictedcolumn is pre-filled with the naive "round half up" guess. Some are right; most are not. - Run, read the ✗ rows, and change each
Predictedto matchActualuntil all eight say ✓. You have then pinned the behaviour.
No peeking at the solution until you have been surprised at least once — the surprise is the lesson.
Your workbench
When every row says ✓, you no longer believe what Math.Round does — you know, and you have written it down as a test that will catch the day it changes.
Been surprised enough? Reveal the solution — the same eight calls with their true outputs and the reason each one bites.