Link Details

Link 114290 thumbnail
User 241715 avatar

By dlinsin
via dlinsin.blogspot.com
Published: Sep 15 2008 / 22:18

A couple of months ago I wrote about my problem of writing test cases before the actual implementation. Last week I came across a little problem, which once again, backed up my position on the broken test first approach.
  • 8
  • 3
  • 1337
  • 389

Comments

Add your comment
User 152955 avatar

Gregg Bolinger replied ago:

0 votes Vote down Vote up Reply

The solution is so very obvious. You stub out the simplest implementation that will allow your test to pass. That means that if it is 5pm you leave at 5:05pm. Return null's, empty methods, whatever. Just make the test pass. Get to green as fast as possible. That is part of TDD.

User 241715 avatar

David Linsin replied ago:

0 votes Vote down Vote up Reply

Call me petty, but stubbing out the implementation doesn't sound right....but if that's TDD, it's probably a viable solution. http://dlinsin.blogspot.com/2008/09/how-to-do-continuous-integration-and.html?showComment=1221543660000#c5371492421977390897

User 160465 avatar

angsuman replied ago:

0 votes Vote down Vote up Reply

Test and the subsequent code validating it are part of each other, they either go in both or none.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (8)



Voters Against This Link (3)