t27.aiРусский

Build it, then measure one thing

You will learn

Why one number read from a run beats a feeling, and what one run cannot tell you.

When your project runs, pick one thing to measure and read it from the run itself. Made-up example: the reading log was run on 4 titles and kept 3. The share kept is 3 x 100 / 4 = 75 out of 100. That is the whole fact: one run, one number. It does not say what the next run will give, so the widget lists that as nothing yet. The spec has 3 tests: a measure needs at least one run, a run cannot keep more than it was given, and the share is read from the run. Set KEPT to 5 and two of them go red.

Try it

In the spec, set KEPT to 5 and read the 2 tests that fail; then put it back. Pick one thing in your own project that a run can print, and write down how you will read it.

Open the interactive lesson →

Build it, then measure one thing: a share read from a run ↗

One run of a made-up reading log, one number read from it, and what that number can and cannot tell you. Lesson 26 of the Vibecoding course.

specs/vibecoding/measure.t27

// SPDX-License-Identifier: Apache-2.0
; Vibecoding, lesson 26: Build it, then measure one thing.
; After your project runs, pick ONE thing to measure and read it from a run, not from a hunch.
; Made-up example: the reading log from lesson 25 was run on 4 titles and kept 3 of them.
; The measure is the share kept. Plant a bug: set KEPT to 5 and see which test goes red.
; phi^2 + 1/phi^2 = 3 | TRINITY

module vibecoding_measure;

; What the run printed.
pub const RUNS : u8 = 4;
pub const KEPT : u8 = 3;

test a_measure_needs_at_least_one_run {
    assert RUNS > 0;
}

test a_run_cannot_keep_more_than_it_was_given {
    assert KEPT <= RUNS;
}

test the_share_kept_is_read_from_the_run {
    assert KEPT * 100 / RUNS == 75;
}

Open the lesson's spec in the player ↗

All lessons