|
|
|
|
|
by hitchstory
495 days ago
|
|
I hate coding fundamentalism with a passion too. The only thing I get really religious about in coding is the importance of trade offs. 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.