DEV Community

Discussion on: To mock, or not to mock, that is the question

Collapse
 
ant_f_dev profile image
Anthony Fung

Yes - good point about the distribution of test types.

I suspect that the prevalence TDD has something to do with that. I'm not saying TDD is either good, or bad - I'm just saying that it encourages writing unit tests and then filling in the implementation.

With so many jobs on the market that want TDD as a requirement, my guess is that many people learn to do TDD with unit tests and don't think much about the other possibilities.

Thread Thread
 
kondrashov profile image
Alex Kondrashov

I agree, TDD is having an effect on this. Although I've done TDD in the past where I wrote couple integration tests which was convinient.

Thread Thread
 
ant_f_dev profile image
Anthony Fung

It's definitely worth testing a chain of components when it's the easiest way.