Hacker News new | ask | show | jobs
by pianoben 1623 days ago
This is exactly how I feel as well! Units in isolation certainly deserve testing, but the actual long-lived value comes from testing the public interface of the module/program/etc. In one compiler project I maintain, I stopped writing unit tests years ago in favor of just feeding it input like users would and asserting on the outputs. It gives me both great freedom to refactor quickly, and great confidence that I'm not regressing.

As you say, depends on the project. What I described above is entirely free of side effects - I wouldn't dream of testing a web service this way.

Of course integration is never in conflict with unit testing - they're different and can happily coexist.