Hacker News new | ask | show | jobs
by crazygringo 262 days ago
> Why do you need both?

Sure, you don't need unit tests if you don't need unit tests because a program really is that simple. But that's an exception for tiny programs/modules, not the rule.

> eventually you reach a place where more tests, even those recommended as best practice, don't actually deliver any more _real world_ value

I explicitly said unit tests are for algorithmic code that can have logic errors. Obviously, if you've written tests for all those, you don't need any more.

> and even make the code harder and slower to maintain.

But you can trust the code is correct. Obviously this is the tradeoff, and for anything serious it's the right tradeoff.

You seem to be arguing against tests generally except for the most superficial ones. That's a recipe for buggy and often hard-to-understand, underspecified code.

1 comments

I'm arguing for appropriate, practical levels of testing, which could sometimes mean not all code has both unit and integration tests. I think that's the point the article is making: you don't always need both, focus on real world value.