|
|
|
|
|
by davethedevguy
1035 days ago
|
|
Most criticisms of unit tests in articles like this are actually criticisms of bad unit tests. They also overlook a large part of the value of unit tests, which is fast feedback during development time.
We could push all of our tests up to the browser level, but then I lose the almost instant feedback that unit tests give me. Sure, if your tests mock everything, and only test individual methods, then they probably are brittle and provide little value over more 'expensive' (e.g. slower) tests higher up the test pyramid. If the tests only interact with the public APIs (e.g. the 'ports' in a ports and adapters architecture), then they are less coupled to implementation, can represent real business scenarios (instead of 'input x gives result y'), and add more value. |
|
You've fallen into the very trap of terminology the author mentions at the beginning of the article.