Hacker News new | ask | show | jobs
by astrange 1476 days ago
In my experience people who learn about “testing” learn an inflexible TDD based version where everything has to be covered in unit tests, meaning everything has to become overly complicated so dependency injection will work instead of merely creating the only thing you’d ever want it to use.

If you’ll allow other things like integration tests as the first level of testing, things get simpler. Unit tests aren’t the only kind of test and in fact they’re the least good kind.

1 comments

Ye I agree. Unit tests are fine for small things that can be tested in isolation. Like "reverse string" etc.

For more complex things I prefer integration tests. I.e. "program output tests".