DSimon comments on Coding Rationally - Test Driven Development - Less Wrong

25 Post author: DSimon 01 October 2010 03:20PM

You are viewing a comment permalink. View the original post to see all comments and the full post content.

Comments (82)

You are viewing a single comment's thread. Show more comments above.

Comment author: DSimon 01 October 2010 03:34:43PM *  0 points [-]

Okay, I think I see where you're going, but let me double-check:

You're saying that false positive tests are weeded out in TDD because the implementation isn't allowed to have any code to raise errors or return negative states until there's first a test checking for those errors/states.

So, if an everythingWorkingOkay() function always returns true, it wouldn't pass the test that breaks things and then makes sure it return false. We know that test exists because ideally, for TDD, that test must be written before any code can be added to the function that is intended to return false at all.

Whereas, if the programmer writes the code first and the test second, they might well forget to test for negative output, since that possibility won't come to mind as readily.

Comment author: Morendil 02 October 2010 09:17:31AM 0 points [-]

See this other reply for more detail.