5 ms·
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
by swanson 14y ago
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.
- niggler 14y agoTest-first is also broken, because you end up crafting code that suits the test coverage. https://github.com/shtylman/node-int/issues/1#issuecomment-12757935 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.