News for hackers. Stuff that matters.
Re:Unit Testing is Overrated (2020) by Ygg2 on Thursday April 07, 2022 @07:06AM (#30942961)
> "Considering the factors mentioned above, we can reason that unit tests are only useful to verify pure business logic inside of a given function."

> That just isn't true and it makes the rest of the blogpost also not true.

It's not? Writing unit test is all about minimizing side effects and interaction with other systems.

Re:Unit Testing is Overrated (2020) by fivea on Thursday April 07, 2022 @07:12AM (#30942986)
> It's not? Writing unit test is all about minimizing side effects and interaction with other systems.

Not really. Writing unit tests is all about verifying behavior from combinations of inputs, and side effects are inputs as well.

You can write unit tests that inject delays and timeouts and retries and throw exceptions under specific circumstances.

Re:Unit Testing is Overrated (2020) by Ygg2 on Saturday April 09, 2022 @09:46AM (#30968028)
> Not really. Writing unit tests is all about verifying behavior from combinations of inputs, and side effects are inputs as well.

Well, except it's not. If you use a side effect, you have to account for it in some way via mocks or whatever.