| I stopped reading right here: "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. A unit test should test "a unit of functionality" not just a method or a class. Your unit tests also shouldn't be coupled to the implementation of your unit of functionality. If you are making classes or methods public because you want to unit test them, you're doing it wrong. The exception is maybe those tests you are writing while you're doing the coding. But you don't have to keep them around as they are. |
Me too. The author shows a deep misunderstanding and even obliviousness to testing, particularly from a practical point of view, that takes any credibility from any argument listed in the article.
It's even perplexing how the best example the author could come up with was this absurd chain of strawmen that a) it's impossible to test code that uses instances of HttpClient, b) dependencies used in dependency injection "serve no practical purpose other than making unit testing possible."
There are plenty of people talking about unit tests. This article is not one of which justifies any click.