Hacker News new | ask | show | jobs
by gaganyaan 1523 days ago
I honestly heavily prefer integration tests exactly because unit tests can miss the bigger picture. Search for "two unit tests, zero integration tests" if you'd like an easy-to-digest thing to share with your coworkers.

Don't get me wrong, unit tests are still useful. But someone needs to have the big picture in mind, and say "what happens if a human does this?" and consider all of the disparate component that may be involved in that action.

As a concrete example, don't rely on API requests to say that your microservice is fine. Boot up a full browser with Selenium to act as an actual user and start poking around the frontend. You'll probably say "oh right, I should fix that" at least a few times.