A regression test is a “fuse” that prevents a bug you already fixed from showing up again: we make the problem reproducible, write a failing test, fix the code, and keep the test forever. In this lecture we break down the regression cycle, a Go example with
panic/
recover(), a guard clause for
len checks, a
mustNotPanic helper, and also the rules: what exactly to lock in with a test (a result, an error, or the absence of a panic) and how to name such tests.