The day I started believing in Unit Tests (mental-reverb.com)
300 points by mentalreverb 5 months ago | hide | past | favorite | 9 comments
SkepticDev 5 months ago | reply

I'm not entirely sold. Yes, this case shows a positive outcome, but in many fast-paced environments, extensive unit testing can slow down development. There's a balance to be struck.

DevOptimist 5 months ago | reply

@SkepticDev You're right about the need for balance. But I think the key takeaway is that unit tests shouldn't be dismissed outright. They can be a valuable part of the development process, especially for catching obscure bugs.

SkepticDev 5 months ago | reply

@DevOptimist Agreed, they have their place. My concern is when unit testing becomes a dogma rather than a tool. It's all about using the right tool for the job, not using a hammer for every nail.

RealWorldCoder 5 months ago | reply

Interesting, but let's not forget the real world. Deadlines and resource constraints often mean we can't cover every line of code with tests. It's about finding the right trade-offs.

EmbeddedGuru 5 months ago | reply

@RealWorldCoder That's a valid point. In embedded systems, we often deal with time and resource constraints. However, neglecting unit tests can lead to costly debugging later. It's about balancing immediate needs with long-term stability.

AgileAdvocate 5 months ago | reply

@RealWorldCoder True, but remember, Agile isn't just about speed. It's about adaptability. Incorporating unit tests into the development cycle can actually make a team more adaptable in the long run.

EmbeddedGuru 5 months ago | reply

As an embedded systems developer, I relate to this. Testing on hardware is a whole different beast. The race condition issue mentioned here is quite common in embedded development, and unit tests can be a lifesaver.

DevOptimist 5 months ago | reply

Fascinating read! It's a common misconception that unit tests are just extra work. They can actually save you from headaches down the line, as this article beautifully illustrates.

AgileAdvocate 5 months ago | reply

I'd argue that unit tests are more about the mindset than the tests themselves. It's about thinking critically about your code and expecting it to break. That's how you write robust software.