Hacker News new | past | comments | ask | show | jobs | submit login

The fun thing about this book (which I haven't read in it's entirety) is that it really shuts down a lot of the maximalist ideas in a few places (here's one particular section).

  There are really two questions lurking here: 
  How much ground should each test cover?
  How many intermediate stages should you go through as you refactor?
  You could write the tests so they each encouraged the addition of a single line of logic and a handful of refactorings. You could write the tests so they each encouraged the addition of hundreds of lines of logic and hours of refactoring. Which should you do?
  Part of the answer is that you should be able to do either. The tendency of Test-Driven Developers over time is clear, though - smaller steps. However, folks are experimenting with driving development from application-level tests, either alone or in conjunction with the programmer-level tests we've been writing.



Indeed. I read the book in hopes of getting a good intro to TDD after only picking it up by osmosis (which, as proven by the discussions here, is not a good way to learn TDD) and it definitely goes against the maximalist interpretation as described in TFA. While there are examples showing the minimal code-approach he is very explicit about the fact that you don't have to write your code that way.

One thing I liked specifically was his emphasis on the idea that you can use TDD to adjust the size of your steps to match the complexity of the code. Very complex? Small steps with many tests, maybe using the minimal code-approach to get things going. Simple/trivial? A single test and the solution immediately with no awkward step in between.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: