You are viewing a single comment's thread.

view the rest of the comments →

0
1

[–] taxation_is_slavery 0 points 1 point (+1|-0) ago  (edited ago)

If you're paid by the hour they are wonderful wastes of time. Though I prefer more interesting things, if you hate the company you're doing work for it's one option.

0
1

[–] boater 0 points 1 point (+1|-0) ago  (edited ago)

I think whether or not unit tests save you time depends on your development methodology.

They work well in conjunction with pure functional programming, where one might write a 10 line function, and then a 2 line test below it in the same file, where the test is just a boolean function equality test returning whether or not the primary function returned the expected return value when it was called with a handful of input parameters.

I would agree that writing unit tests for non-determinsitic input-output code or writing unit tests in a seperate file or folder than the code being tested can be a waste of time, but if you have your build system setup to automatically parse unit test signatures from your modules and automatically generate a custom binary to call them, they can be a convenient way to clarify an API and make it feel more stable during the process of writing it.