TDD is BS?

deadalnix deadalnix at gmail.com
Thu Jun 20 05:16:52 PDT 2013


On Thursday, 20 June 2013 at 10:13:53 UTC, Jacob Carlborg wrote:
> On 2013-06-20 00:47, Nick Sabalausky wrote:
>
>> - Writing a unittest first forces the API to be designed 
>> before the
>>   implementation is written. But implementation is necessary 
>> to flush
>>   out unexpected design requirements (If you think you can 
>> always
>>   come up with an appropriate design and interface before
>>   implementing, then you're just plain wrong). Sometimes the
>>   appropriate design and API is obvious. Sometimes it isn't. 
>> When it
>>   isn't, then TDD skirts dangerously close to some of the 
>> problems of
>>   "Waterfall Model". Sure, TDD advocates 
>> refactoring-as-needed, but I
>>   can do that with or without TDD.
>
> Just because you have written a test doesn't mean you cannot 
> change it. Perhaps you come up with a better API design, then 
> change the tests.

When I start something, it isn't always clear what mental model 
of the problem fit best the problem. I usually wait until I know 
I have a consistent mental model of the problem to write test. 
Otherwise, tests tend to get into your way to change the API( 
because you need to change tests as well. I start writing test 
when I know what kind of API make sense (it isn't always 
finished, but I know what it will look like overall).

Which lead to TITMOD, test in the middle of dev.


More information about the Digitalmars-d mailing list