3 ms·
As much as I've tried, I really can't get into "test first" development. I find that I make so many tiny changes when I am first working on a new project, and r
by ayb 16y ago
As much as I've tried, I really can't get into "test first" development. I find that I make so many tiny changes when I am first working on a new project, and refactor so much, that the tests would really slow me down.
But once things get more solid for me (and, like you said, I know the code has some long term value), I'm a big fan of building a solid test suite before a full production launch.
I also think it is worth the time to use code coverage tools to find sections that are not being covered. Odds are your test suite only covers 60-80% of the total logic in your app.
- bphogan 16y agoFor me it was a discipline thing. Then a mentor of mine convinced me that not writing tests was actually okay when you're exploring something. He suggested I only write tests for "production" code - something I would deploy. So I routinely would whip something up, see that it works, then start a new project with tests and rewrite my experimental code. You can imagine what ended up happening - I realized how much time this was wasting, so I started writing tests to test my experimental code so I didn't have to throw it away. I got my brain hacked. Maybe that story will help someone else. :)
- joske2 16y agoHow can you refactor if you don't have a test suite? Do you manually check everything in your application after every change? That's the main value of having a test suite you can trust. It speeds up refactoring massively.