With the internal refactors I'm making in , my unit-testing has gone out the window. I'm usually too excited to just "get it done" than write tests and then adhere to them. Which is 2x easier when you're simply writing code the first time around.

I'll be writing tests again, re-using what's possible, which will do for a side project, but I get the sense refactoring *using tests* is an art. It doesn't help tho, that this is breaking into 3 repos -- not even within the same 1!

@celia I'm not a fan of writing tests just because you have to write tests. But if the tests actually help you not to screw up some modules, you're doing it right.

@garritfra @celia I'm in the camp that believes that having tests is merely a (positive) byproduct of .

I see it mainly as a design tool. It pressures you to build systems in a particular way, and shortens the design feedback loop. If you build a tightly coupled system that's hard to. test, you are in for trouble eventually.

Tests will give you that feedback (you will feel the pain) and if you have the tests first, you won't even start building that monster.

@garritfra @celia I hear you. I draw the line at TDD - it feels like building a pyre of test-writing effort to sacrifice to the code gods.

But I have found that once you know how to efficiently create test suites to verify your assumptions, your code quality drastically increases and you can work more quickly.

How coupled your tests and your implementation are ?
Refactoring should not break much tests unless you decide to change your API

Sign in to participate in the conversation

Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.