I feel unit tests suck when there is a complex external entity (database, etc).<p>Sure, one can mock the thing and test that an expected series of queries were made. But if one can confidently claim those expected queries always match the desired behavior, then the original code was probably already correct.<p>It’s too easy to just write “dumb” unit tests that merely confirm the code still executes the same inscrutable sequence of things it did when the test was first written…<p>Writing useful unit tests is often much harder…