Daily iOS
Testing

Why unit tests

A teammate says they'd rather build one more feature than spend the time writing tests. How would you make the case for unit tests?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

Unit tests catch regressions automatically, make refactoring safe, force a testable design by separating dependencies, and work as executable documentation. The cost is a few seconds of build and run; the benefit is one bug that never reaches users.

Share a question