DEV Community

Discussion on: Why You Should Be Unit Testing

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.

restoreddev profile image
Andrew Davis Author

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.