DEV Community

Discussion on: The guilt of not testing everything

Collapse
 
pierresassoulas profile image
Pierre Sassoulas • Edited

A mentor once said to me

"If you have to test the sinus function, you can't test every possible values, because this is a continuous function with infinite values. Your work as an engineer is to find a compromise between testing enough so it does not ever break in production, while not being too expensive so that our competitor do not take our business. In order to do that you have to test intelligently."

Every tests is useful should be taken with a grain of salt. A test covering a very small part of the code, never catching any errors and taking 15s every time you launch your test suite should probably be removed...