Hacker News new | past | comments | ask | show | jobs | submit login

Write a test first -> figure out how you want to interact with the code -> then actually start crafting code.

And the test can actually be executed.

I used to do the "sketch it out" a lot more, but I think Test-First is a better approach.




Test-first is also broken, because you end up crafting code that suits the test coverage.

https://github.com/shtylman/node-int/issues/1#issuecomment-1... is an example of an issue which came from an implementation without 100% test coverage. I claim that unless you know every single way in which a function is used, and even if you did, you can't design tests to cover 100% of use cases.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: