Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My personal mentality about TDD is that it is an unreachable ideal. Striving for it puts you on a good path, but business logic is rarely so straight forward.

If you are lucky enough to be writing code in a way that each unit is absolutely clear before you start working, awesome you got it. But in business-logic-land things rarely end up this clean.

Personally, I program the happy path then write tests and use them to help uncover edge cases.



> I program the happy path then write tests and use them to help uncover edge cases.

This approach resonates with me as well. I would add that writing tests when investigating bugs or deviations from expected behavior is also useful.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: