DEV Community

Discussion on: Why unit test culture is broken

vdedodev profile image
Vincent Dedo

I find writing tests to be quite enjoyable, mostly unit tests because of the fast feedback and the lack of dependencies I have to mess with. I use unit tests mostly for checking things work, being sure on edge cases and documentation. The thing that ruins the fun of writing tests is TDD, so I write tests after the code and that works well for me.

Having too much reliance on unit tests is the pitfall here, they're usually brittle and make refactoring more expensive, which will often be mocks being wrong after the change.