**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

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.

← Introduction exercises · Module 1 — Introduction

Reconnecting…
The connection to the server was interrupted. Trying to restore it…
Trying again…
The connection could not be restored. Reloading the page…
The server was updated. Reloading the page to pick up the latest version.