HACKER Q&A
📣 notadoctor_ssh

When do you guys start writing unit tests?


Do you guys follow TDD approach? If you guys do, at what point do you start writing test cases? Any advantages you found by following this approach?


  👤 bbody Accepted Answer ✓
Typically for any personal projects I will do it before any large refractors then keep on top of code coverage going forth. I find this approach let’s me move fast until I reach a level of seriousness.

I sometimes use TDD when adding new functionality, I even created a relatively popular YouTube video on the topic. I find it most useful when I’m coding a particularly complicated function, helps me think through the problem better.


👤 RocketSyntax
I typically don't for my personal projects, but if I was going to publish my code or start collaborating in git it would move toward the top of my todo list.

Or if I started weaving together lots of different parts of the project.