DEV Community

Discussion on: Beginner Tips: Solving Programming Problems

ddarrko profile image
Daniel Benzie

Writing tests take time you might not have

Writing tests will save time in the long run. Writing them before you write the implementation is preferred.

They don't help you narrow down an issue.

If your code is structured properly (aka small functions/classes responsible for singular things) unit tests will tell you at exactly which point your test is failing.

Thread Thread
canderson93 profile image
Carl Anderson

While I agree in a general sense, this article is about coding during an interview -- there is no "long-run" if you only get an hour to solve the problem. If you're spending a significant amount of time writing tests, you're not spending that time answering the question.