DEV Community

Discussion on: Do you even unit test, bro ?

Collapse
 
juyn profile image
Xavier Dubois 🇫🇷

Unit testing should not be writing only by engineers.
Yes, they cost and they can take more time to write than the tested code. Can't disagree here.

But unit testing is the gate keeper. It ensure that, at a low level, your code is doing what is meant for.
And, if well wrote, it is a documentation for the next developer.

Others tests methods, like functional testing, integration testing etc are here to protect your production environment.
Is the data alright ? Are the performances alright ? Is the code style compliant?

They don't have the same purpose, otherwise we'd have stop writing them all already !