DEV Community

Discussion on: Me: "I tested and it works, why do I have to write tests?"

Collapse
 
stickwarslit profile image
Nora Del Rosario

This exactly! One of the best moments was when I did an overhaul to a well-tested code, keeping the interface so that it is still within the specs but completely rewriting/improving the code, then seeing the tests passing still, that is such a wonderful feeling.

I came down to the comments to say this, you beat me to it hehe.

Tests used in this way are like the checkboxes you mentioned in the article. Even if you think you remembered all the use cases, there might be one that you came across before but forgot about during the refactor. If you wrote a test for that use case, the failing test would remind you of that case instead of a faulty build