DEV Community

Discussion on: Are unit tests a waste of your time?

Collapse
 
vinu profile image
vinuchakravarthy • Edited

For the most part, they are a waste. They have very low ROI. I have seen numerous young devs getting obsessed with unit tests and TDD and end of the day it only satisfied their desire, not much in stabilizing the system. On the other hand, integration and E2Es have provided best bang for the buck. If devs are so relying on unit tests, it’s a sign that they are incapable of writing solid code, or prone to write complex logic for simple problems or just simply craving for the dev community buss and a sense of fake self pride. This is what I have seen after working at Enterprise Architecture capacity across 5 organizations in last 10 years, with some systems having more than 200 micro services and 50+ UI apps and monorepos having close to 10,000 test cases running under multiple suites. Learn to write quality code, think of all possible control flows while writing code. If you are spending more than 10% of your development time in writing or maintaining unit tests, you are already lost. If a developer is writing code that causes consistent bugs, he is not a good developer. As simple as that.