Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

11
  • 18
    +1 just for the last paragraph. Your house examples really highlight how silly "religiousTDD" can be. Commented Aug 3, 2016 at 16:22
  • 23
    "What's important is that you make the tests and make them good. The order that you do the work is less important." I am a big fan of Test-Driven-Development (TDD) and advocate for it often. However writing code is messy. For more difficult, less well defined problems I typically have to write some code first before I can understand what are the requirements. Then I can write the requirements and then write the tests. Commented Aug 3, 2016 at 16:36
  • 1
    @TrevorBoydSmith wouldn't you be writing the documentation at that point not the requirements. Commented Aug 3, 2016 at 16:58
  • 8
    Because TDD puts in the perspective of the user of the code, [in best-case] it promotes better interfaces. For example, when I call open_door I shouldn't have to pass a flag for toilet_flushed; so I don't write my test that way and therefore my code doesn't have these "rough edges." Code written entirely without sufficient regard for how it is called often has weird interfaces or assumptions/preconditions. Commented Aug 3, 2016 at 17:44
  • 3
    @TrevorBoydSmith to put a name to it, I've heard that called "Spike & Stabilize" and yes, it's a handy technique when discovering how to do something you don't know how to do yet. Commented Aug 5, 2016 at 16:46