You understand the benefits of refactoring, but you still feel a strong impulse to rewrite larger pieces of your system. You know in your mind that refactoring would be safer and more effective, but it feels too slow for you to choose to do it under the pressure of an industrial-strength situation. What does that mean? What can you do?
If you read enough articles on TDD and testing, you’ll find authors who view mocks with significant suspicion. I think that they criticize the symptom and not the cause. If you count yourself among these people, then you don’t hate mocks, you hate side-effects. I don’t hate side-effects, but I feel glad that I’ve learned how to refactor away from them.
If you’re wondering about whether you should hand-roll your test doubles (mock objects) or use a library, then this article will help you.
Many senior programmers feel nervous allowing their project’s design to evolve in the hands of their co-workers. This article shows one specific example of how a useful abstraction and a small type hierarchy can evolve by following simple design guidelines that anyone can learn.
A software contract is not a legal contract, so let’s not treat it as one.
If you write a Spock test, but forget to subclass from
Specification, then you might not notice the mistake.
(test && commit) || revert amounts to doing TDD very carefully, as an étude. If you already routinely take tiny steps, then you already almost do TCR, but something significant might change if you do it exactly. This remains to discover. Join me.
I have a new Linux laptop and I wanted to run C# code. I had no idea where to start. I last wrote C# for money in 2004. It took me over an hour of hunting to figure out how to run a single test, so I decided to write a tutorial that could help someone else go from zero to NUnit with Visual Studio Code.