TDD is BS?

Sean Kelly sean at invisibleduck.org
Thu Jun 20 11:14:05 PDT 2013


On Jun 19, 2013, at 4:44 PM, Walter Bright <newshound2 at digitalmars.com> wrote:

> On 6/19/2013 3:23 PM, Szymon Gatner wrote:
>> Point of TDD for a square root function would be to create a good API for
>> getting a square root of a number. Implementation is just a detail.
> 
> I just can't accept that. For one thing, implementation details often must drive the interface. Just writing specs without any knowledge of how it would be implemented will not produce an efficient design.
> 
> For the square root, there's a definite tradeoff between accuracy and speed. With no knowledge of those tradeoffs, and just coming up with a spec, how can you make the right decisions?

And this is why the waterfall model (which TDD seems to encourage) tends to be problematic.  That said, I do like the idea of building a program in a way that is testable right from the start, because it can be very hard to bolt on testing after the fact.  For example, basically all the work I do is with distributed programming, which requires extensive mocking to produce any sort of meaningful test.  If the API wasn't designed to allow this, about the only testing that can be done is black-box testing using external apps.


More information about the Digitalmars-d mailing list