← Everyone's take

TAKES · Alex answers

When should we add tests?

When should we add tests?“Before the code. That's the design.”Alex Chen, The Architect

💡 WHY ALEX IS RIGHT

Writing the test first designs the interface from the caller's side: inputs, outputs, errors. Code that is awkward to test hides dependencies, and finding that before implementation is cheap. For long-lived shared interfaces, tests are the contract, so write them before the code decides it.

✅ RIGHT WHEN

The interface will be consumed by other teams and must stay stable for years.

🚩 TOO FAR WHEN

A two-week experiment ships with an in-house mocking framework and a diagram of its test layers.

See all 12Alex's profile