I will write as many tests as I need to feel confident, which depends on context.
And integration tests give me a lot more confidence than mocked unit tests.
I will write as many tests as I need to feel confident, which depends on context.
And integration tests give me a lot more confidence than mocked unit tests.
The cost/benefit of writing a test before just consistently exceeded doing it after for me.
Same for integration, e2e or unit tests (there's never been a rule that says you can only TDD with a unit test).
The cost/benefit trade off for tests with mocks vs. database is a different topic - orthogonal to the practise of red/green/refactor, and one where IMO the trade offs are much less obvious.
It sometimes makes sense for unit tests; I'll occasionally do that when I'm unsure about the API of the code I'm writing since it allows me to spend some time in the user's shoes.
But like I said, I don't do fundamentalism.