News for hackers. Stuff that matters.
Re:Unit Testing Is Overrated by adamkl on Thursday July 09, 2020 @09:56AM (#23780258)
I agree, but if you watch the linked screen cast you can see that its just Gary Bernhardt's take on Hexagonal/Clean/Onion Architecture.

The idea that your business logic should be isolated from external dependencies (in his case, by making the code (pure) functional). That makes it easy to unit test the business logic, and your integration tests should be minimal (basically testing a single path to make sure everything is talking to each other).

Re:Unit Testing Is Overrated by pydry on Thursday July 09, 2020 @12:48PM (#23782117)
This is adapting the structure of your codebase to the capabilities of unit tests.

It has advantages but it's an expensive waste of resources if you have cheap, effective integrarion tests.

Re:Unit Testing Is Overrated by adamkl on Thursday July 09, 2020 @01:49PM (#23782911)
Cheap integration tests is usually an oxymoron (when cheap refers to the tightness of the developer feedback loop).

Gary was coming from the land of Ruby-on-rails where a full set of integration tests could take hours. In that environment, structuring your code to enable easy testing of complex logic makes a lot of sense.

Likewise in a large enterprise environment, where integration testing across a (usually messy) set of interconnected dependencies is a pipe dream.

It's true that over-architecting is something to be wary of, but as usual, there's no one-size-fits-all answer.

Re:Unit Testing Is Overrated by pydry on Friday July 10, 2020 @04:26AM (#23789361)
It's cheaper to have a TDD test that takes 15 seconds to run and launches into an embedded kernel than it is to re-architect your whole system.

It doesn't matter if the whole test suite takes hours. CI servers don't need to be supervised.

Re:Unit Testing Is Overrated by apazzolini on Thursday July 09, 2020 @05:47PM (#23785610)
One of the benefits of writing tests is that it makes it painfully obvious which parts of your codebase are poorly architected. Difficulty in writing tests is a code smell.
Re:Unit Testing Is Overrated by pydry on Friday July 10, 2020 @04:21AM (#23789337)
That's because unit tests couple tightly to your code. If you're trying to couple something additional to your already tightly coupled code it's gonna be painful.

It's a really expensive way of discovering that you wrote shit code.