3 ms·
Only read the intro. I can't read any more, because I'm super confused by this piece of writing. But you asked for feedback, so (limited to intro): > Folks in
by theteapot 4y ago
Only read the intro. I can't read any more, because I'm super confused by this piece of writing. But you asked for feedback, so (limited to intro):
> Folks in the know use mocks and spies (I say “mocks” for short in this article) to write isolated interaction-based tests. Their tests are reliable and fast, but they tend to “lock in” implementation ...
Depends on how you implement it. Mock almost by definition does not lock in implementation as it is a reimplementation of an interface. Spies yeah OK, but depends on how you use. You should probably distinguish between Mock and Spy or state why you conclude they lock in implementation.
> Bad tests are a sign of bad design, so some people use techniques such as Hexagonal Architecture and functional core, imperative shell to separate logic from infrastructure.
You could have said: "Bad tests are a sign of bad design, so some people improve there design.". Genius move. Hexagonal Architecture has nothing to do with it, it's wild conjecture that Hexagonal Architecture is going to improve anything.
> (Infrastructure is code that involves external systems or state.)
No, it isn't. Maybe you confusing Infrastructure-as-code with Infrastructure-is-code.
> It fixes the problem... for logic.
What problem? If we trust you, we hypothetically improved the design and architecture. Test can still be bad. I would drop this whole "Bad tests are a sign of bad design ..." paragraph. I mean why the heck are we talking about Hexagonal Architecture here.
> The patterns combine sociable, state-based tests with a novel infrastructure technique called “Nullables.” At first glance, Nullables look like test doubles, but they're actually production code with an “off” switch.
Man, just because you comingle you mock with your actual code - which seems very anti SOLID - doesn't make the thing not a test-double. It's still a test double, just a weirdly coupled one.
> The rest of the article goes into detail. Don’t be intimidated by its size. It’s broken up into bite-sized pieces with lots of code examples.
The rest of the article is like a book that has nothing to do with the title of the article? You should explain what all that is or put it somewhere else.
Hope that helps.