DEV Community

Discussion on: Why You Should Be Unit Testing

Collapse
restoreddev profile image
Andrew Davis Author

I don’t do TDD religiously, but I’m trying to move in that direction. Writing the test before code makes you write your code in a more testable way.

Typically I will mock and do integration. I like mocking when I’m testing a small piece of functionality and I want to mock away another dependency so I don’t have to worry about it. But then I’ll have an integration to make sure it all works together.