9 comments

[ 4.2 ms ] story [ 28.8 ms ] thread
Your Website seems to be messing with browser history. Back button will not take you back to HN.
Anecdote time: I worked on a project with a senior dev who was really into unit testing and only unit testing. The software had to be fully tested as tiny little lego bricks with mocks galore. Because "if all the pieces were correct, the combination had to be correct" - his words. (I guess he'd never considered emergent behavior)

I'll never forget the cycle, after staunch objections to integration/e2e/manual tests and zealously insisting on full unit test coverage, the senior dev deployed changes ... boom. The process failed hard minutes after start because there was a bug in main. Full production outage. A bug so obvious we should have caught it by eye. Clearly, in the weeks developing the feature, he had never bothered to even run the application. Each part was fully polished in isolation but utterly failed when integrated into an application.

The way I've come to think of it: Unit tests are for libraries, a closed world where you can neatly define all inputs and outputs. Integration/E2E tests are for applications, an open world which require systems thinking, simulations not proofs. Know which world you're working in!

That doesn't really sound like an indictment of unit tests. I don't really understand why someone would meticulously write a bunch of unit tests and then wait to prove them on a production deploy?

Unit and integration tests serve different purposes and one isn't necessarily better than the other.

> Unit and integration tests serve different purposes and one isn't necessarily better than the other.

If they serve different purposes, then one is by definition better than the other, given the circumstances.

There's a whole class of applications containing very little pure logic; dumb pipes hooking together a database and client over a network. It's a categorical mistake to fully unit test these. There are no "units" to test! Everything is a side-effect (disk, network, etc). Yeah you can mock. My point is that mocks do not cover real world behavior, so those types of apps require an integration/e2e heavy set of tests.

Conversely, if you've got a logic-heavy library, you need unit tests. You can't rely on the behavior as filtered through the application.

Different purposes. But depending on what world you're working in, one is definitely better than the other.

Skimmed through this. One heading is "The gap was never coverage. It was wiring.". Smeḷls very AI sloppy, won't bother reading...

I used to read anything and everything on HN, but my allergy to slop has made me stop doing that. I suppose that's a good thing?

> Opens the front door

This is the most recent AI slop phrase the models produce, keep an eye out you'll see it everywhere.

"The honest summary is that a plain-English end-to-end layer would fill a real and currently empty tier, sitting on top of roughly two thousand fast deterministic tests doing work no browser tool can do. Both halves of that sentence are load-bearing. A vendor who only says the first half is telling me they have not read a codebase like mine."

A person who posts an article like this is telling me they have neither written nor read their article. Or their own code base, for that matter. So this person had problems in a code base he didn't write, didn't read either, it seems, and now wants all of us to read an article about this zombie code base, except he also didn't write or read over that article before posting it.

To the author: Your article can be rewritten in a few sentences like this: "I vibe coded a code base and asked Claude to add tons of unit tests. I didn't read the code or the tests; just wanted it to work. But I either didn't know to ask to wire the tests into my CI/CD pipeline, didn't know what that was, or did know but was too lazy to check that it happened. Anyway, I sure learned my lesson: What happens in localhost:3000 stays in localhost:3000. Gotta wire up your .github/workflows/cicd.yml file to pull in your tests. Otherwise it really doesn't do much for you. Lesson learned!" And you know what? As banal as that would have been, I would have enjoyed that article so much more. Just take 5 minutes man. Five freaking minutes.