Refactor like you're moving furniture: photo first
transcript
Every team has a class nobody dares touch. It prices, charges, and sends mail. So how do you change it safely? Take a photo first.
Moving furniture, you photograph the room first. After each move, you compare. A missing chair is always the last move.
For code, the photo is the totals it prints today. Four orders: 397, 350, 776, and 40. Now a slip. Tax rounded up, not down. Order B is 351. The pin says 3 of 4 match. You know which step to undo.
Take order D, the awkward one. A cart of 900, and a flat coupon of 1000. The coupon takes off 900, not 1000. The customer still pays 40 for delivery. A rewrite would easily lose that rule, because nobody wrote it down. The photo remembers it.
Behaviour and structure never change in the same step. Pin first. Then take small steps. Each one ends green.
Full breakdown in the lecture.