For me at least, designing a test will usually let me discover problems with my code which may otherwise gone unnoticed.
Leaving the tests there once written to help us in future refactoring costs nothing.
Granted, in some languages tests are more complicated to write compared to others. In PHP it’s a nightmare, in Rust it’s so easy it’s hard to avoid doing.
I hear what you are saying though, sometimes writing tests consume more time then is necessary.
I completely agree with what you're saying - tests help me ensure nothing breaks and change stuff fast. But leaving EVERY code behind is a liability. In the best case, it's free, otherwise, it's another point of failure and other engineers might spend time understanding it.
Code is a liability. It has to have a good reason to be there in the first place - in the case of tests, it's worth it because it saves more time on bugs, but this can easily turn into a premature optimization.
Leaving the tests there once written to help us in future refactoring costs nothing.
Granted, in some languages tests are more complicated to write compared to others. In PHP it’s a nightmare, in Rust it’s so easy it’s hard to avoid doing.
I hear what you are saying though, sometimes writing tests consume more time then is necessary.