Automating Tests in Elixir Projects

I genuinely don’t understand how we keep reverting to “camps.” We’ve already acknowledged that testing strategies exist along a spectrum of trade-offs, and in my last reply, I referenced the “classist vs. mockist” debate specifically to illustrate that spectrum — not to promote binary thinking.

It’s not controversial that some developers lean toward testing behaviors and avoiding implementation details, while others lean toward testing unit interactions and dependencies. There are nuanced trade-offs within those approaches, as I believe we’ve agreed.

And from that, it naturally follows that most developers will engage in some form of mocking, however infrequently. That’s why my blog post focuses specifically on the how of mocking.

While I respect the preferences being expressed here, I want to be clear: my involvement in this thread is focused on the technical mechanics of mocking. The “when” question is also valuable, but it deserves space to explore the trade-offs with care and depth. That’s blog post material — not something to untangle in a forum thread.

So, with respect, I’ll step away from this sub-topic. If mocking is still considered “only when absolutely nothing else can possibly work” even after multiple replies here have highlighted the nuance, then we likely see things quite differently. And that’s okay. I reject the position that pushes mocking to an extreme edge, just as others can reject mine. My focus here remains on how to mock — specifically to avoid this kind of circling.

1 Like