3 ms·
If I build the unit first and add tests later, it's more likely I'll end up with something where the API reflects the implementation. With test last, I'm also l
by zzalpha 10y ago
If I build the unit first and add tests later, it's more likely I'll end up with something where the API reflects the implementation. With test last, I'm also less likely to test everything well; after the implementation is done, I believe it works.
Will you?
Are you sure?
Do you have data to back your supposition?
My contention would be that at the end of the day, the requirements of the interface to support unit testing will result in a very similar set of design choices, whether you write those tests up-front, as-you-go, or after-the-fact.
The only difference is that if you write them after-the-fact, you may push some amount of refactoring to the end of the process instead of doing it along the way.
But I'll bet you have about as much data as I do to back your beliefs. ;)
- wpietri 10y ago> Do you have data to back your supposition? That's my experience. I started doing TDD more than 10 years ago, and it took me about a year to fully make the switch from test-after to test-first programming. I regularly try experiments with different personal code bases. If you're arguing from personal experience, that your code ends up just the same either way, good for you. But I suspect you're arguing from theory here.