DEV Community

Discussion on: Write an Integration test, not a Unit test

Collapse
 
carlovo profile image
Carlo van Overbeek

I guess the truth is somewhere in the middle. TDD can be done on integration tests as well. Also, on unit tests you usually have to mock out stuff, but what are you going to mock if you haven't yet decided on the implementation? In the end, the test design choice of a good developer beats a static rule of what tests to write first.

That being said, the best developer experience I ever had was on a project where I had to extend integration tests and then build functionality for it. Some unit test were there as well, but had only been build in the start of the project. Newer parts were not unit tested. When the bigger picture of the project became clear the shift was made from unit test to integration test driven design. I think I'm going to advocate this flow as well if I'm at a new project inception.

Collapse
 
kondrashov profile image
Alex Kondrashov

I had similar experience where I would TDD with integration tests. Worked well