Hacker News new | ask | show | jobs
by th3byrdm4n 823 days ago
This assumes useful tests.

There's a false equivalency drawn between writing tests means you wrote good code. In reality, those who can write good tests can also write good code.

My rules of thumb: "Be a goldfish" - Forget everything you know about your project, is it complicated, non-intuitive? Tests + clear documentation.

But don't test for stupid stuff.

AI's already generate+test the stupid stuff for us anyway ... why are we writing it

1 comments

Exactly this. Most of the tests reimplement the implementation using mocks. Such tests are useless, as they always prove the code is correct. Worse, such tests make refactoring much slower. On a low level, only black-box interface tests make sense, and on a high level, use scenario testing. The implementation has to be tested indirectly, otherwise, it leaks.