DEV Community

Discussion on: Why You Should Be Unit Testing

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

Testing should not prevent anxiety, it should only lessen it.

Unit tests should not be relied upon to catch defects. When refactoring, or writing new code, it's important that you pay as much attention as if you didn't have unit tests. Testing can't make up for bad engineering.

I use extensive unit testing to validate and support my code, but my code can always stand on its own.

Collapse
 
restoreddev profile image
Andrew Davis

I think good tests force you to use better engineering so in that way it makes your code better. Testing won’t catch every defect, but it will help to cut out a lot of them.