Hot take: if you wrote a test and it never broke, you didn’t need that test
@nikitonsky Hm...isn't it the same as saying:
"If you never crash with your car, you won't need that seatbelt."
It's all about probability and reducing risk. You never know beforehand what might happen.
@nikitonsky@mastodon.online most tests I write are because someone else might break them in future.
@nikitonsky we had a system at a previous job that kept track and then stopped running them on every PR. (They would still run over night though.)
@nikitonsky that’s why I write them broken
@nikitonsky I often write tests just to confirm that something works the way I expect it to before moving on. Once it's written, I tend to just leave it.
If I'm working on Clojure I do that kind of quick test in the REPL, but I'm usually not working in Clojure.
@nikitonsky True. But you might still. Regression tests are that way.
@nikitonsky I've been wondering about this for years. I keep thinking: suppose you could keep track, across all developers in the organization, of which tests failed the most often, and which never failed at all? Couldn't you learn something from that about what sort of tests are most useful to write?