DEV Community

Alex Pushkarev
Alex Pushkarev

Posted on

Integration tests are better than unit tests?

Some people think that Integration tests are better than Unit tests and that we should rely on them more. In some places, people are even discouraged from writing unit tests.

These people, even though well-intentioned are usually wrong.

First, there's no such thing as "Ideal test distribution" or "best level of tests". Tests that are cheaper to write and run are usually the best type of tests.

Depending on your system under test milage can vary, but in the vast majority of cases, unit tests are cheaper to write and run.

One other thing is that there're lots of misconceptions about what 'unit test' is. But that is for another post.

Image description

Top comments (2)

Collapse
 
mcsee profile image
Maxi Contieri

lets write about unit test misconception!

Collapse
 
dadyasasha profile image
Alex Pushkarev

absolutely! This is a huge topic so I might need some time to come up with a decent post