
9 min read
How to Write Unit Tests That Actually Help
Write unit tests that catch real bugs: name for behavior, use Arrange-Act-Assert, mock only boundaries, and skip brittle implementation-detail tests.
Category

Write unit tests that catch real bugs: name for behavior, use Arrange-Act-Assert, mock only boundaries, and skip brittle implementation-detail tests.

With AI writing half the code, clean code principles matter more, not less. A checklist to audit naming, function size, comments, and tests in 30 seconds per PR.

How to refactor legacy code safely in the AI era: pin behavior with characterization tests, ship tiny reversible steps, and use the strangler fig pattern.

Advanced TypeScript patterns for cleaner code on TypeScript 6.0 and the 7.0 Go compiler: discriminated unions, branded types, and type-safe builders.