Automating Tests in Elixir Projects

but generally you have a 2 module setup

I appreciate your point here, and to me what you describe is complex. It’s cognitive load. A delayed gotcha of sorts. I don’t say that to convince you of course, but to illustrate the spectrum of the testing topic.

On internal mocks, it never fails to elicit a strong response - and no disrespect at all, I actually find it fascinating how wide our “testing tent” is. What I describe and what you’re advocating (perhaps loosely: mockist vs. classicist) both have passionate, experienced camps behind them.

I’ve seen systems where a few well-placed mocks helped a team move forward, just as I’m sure you’ve seen systems suffer from mock abuse. I like to think there are reasonable compromises in the middle - but that only works if we can talk openly about how to mock well, so we can better decide when it makes sense to do it.

I sometimes wonder if each camp is just wired differently - like trying to work left-handed when you’re right-handed - and I suspect the best solution is typically Conway/architectural: put us on two different teams :joy:

Anyway, I know even that framing won’t sit comfortably with everyone, and I respect that. It’s part of what makes testing such a rewarding and sometimes difficult topic to explore.

1 Like