TDD is BS?

Jonathan M Davis jmdavisProg at gmx.com
Wed Jun 19 15:58:56 PDT 2013


On Wednesday, June 19, 2013 23:51:42 Joseph Rushton Wakeling wrote:
> Well, it occurred to me that with a bit more up-front testing thought, the
> bug in RandomSample that we discussed recently might never have happened --
> it feels more like the tests are playing catch-up to the code, rather than
> the code to the testable design decisions.

Well, I think that if it's being done right, the tests are fairly complete 
before the code is ever commited, and there are plenty of cases where Phobos 
has pretty sparse testing. However, even if you have solid testing, you 
sometimes miss stuff and have to add further tests later.

Now, if what you're referring to is the issue where a function which used save 
used isInputRange in its template constraint, I would say that that was a 
fairly clear case of having inadequate tests before the code was submitted. 
But std.random is one of the older range-based modules, and we've come a long 
way since then (and we're still improving), so it doesn't surprise me at all 
if it's lacking some of the basic tests that it should have.

- Jonathan M Davis


More information about the Digitalmars-d mailing list