36 ms·
I stand by what I said. It's unconventional advice and goes against industry "best practice" - plenty of people will imply that if you're not writing your test
by simonw 2y ago
I stand by what I said.
It's unconventional advice and goes against industry "best practice" - plenty of people will imply that if you're not writing your tests before your implementation you're "doing it wrong".
I think that advice causes people to skip writing tests entirely and feel guilty about it, because often writing test first really does slow down your development process substantially in many cases.
My experience is that writing tests after the implementation gives me all of the value of writing the test before but takes genuinely about half the amount of time.
You can't do snapshot testing if you force yourself to write the tests first!
- pydry 2y ago>I think that advice causes people to skip writing tests entirely and feel guilty about it I dont think guilt or lack thereof is a good rationale for any development practice. It actually annoys me that people so often add a moral dimension to development practices. The only question that matters is "does it work well?" >You can't do snapshot testing if you force yourself to write the tests first! Yes you can you can write the whole test, you just cant lock the snapshot artefact(s) in until you've written the code.