Settings

Theme

Ask HN: Bad tests better than no tests?

1 points by devcheese 10 years ago · 1 comment · 1 min read


I can see this going both ways. But I think a project without tests would be less toxic than a project with bad tests. I'm curious what your thoughts are on this.

viraptor 10 years ago

It depends how bad they are. I'd say the threshold between bad and useless for me is: 1. Do you have to change unrelated tests to still pass as you add features? 2. Do the tests ever catch issues as you modify related code?

They may be bad, but if they work and don't get in the way, there's no reason to remove them. Even if they're useless, you're pretty much guaranteed to prove yourself incorrect the moment you delete them (you'll introduce an issue they would catch). In most cases it's better to just leave stuff in until it can be rewritten properly - removing should be the last resort.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection