On Jun 19, 2013, at 2:59 PM, Jonathan M Davis <jmdavisp...@gmx.com> wrote:
> 
> It's not necessarily the case that you write _all_ of the tests and then all 
> of the code, but as I understand it, with TDD, you write a test for a 
> function 
> before you write that function (though both could be written well before 
> other 
> functions and whatever tests go with them). And I completely disagree with 
> the 
> idea of writing a test for a piece of code that doesn't exist yet, even if 
> you're going to write it immediately after writing the test.

The video is quite good but takes a long time to get to the really interesting 
stuff.  Regarding TDD, one point he makes that seems worth repeating is that by 
focusing on the behavior of single functions you're really just doing bottom-up 
design.  He mentions some studies or at least anecdotes from projects that 
tried TDD and they all agreed that as time went on, their code entropy 
increased, which seems to support the idea that TDD at least encourages people 
to do bottom-up design.

The more interesting point he makes, however, is about how difficult it is to 
understand and therefore accurately test object-oriented programs by virtue of 
how such programs are traditionally built.  So the problem really isn't so much 
TDD as that it's often difficult to derive anything truly useful from the 
results.  He then goes on to talk about DCI (Data Context Interaction), which 
is essentially a different way to build OO apps that more closely models what 
the apps actually do.  So you could really use TDD in combination with this DCI 
design approach and end up with something a lot more useful.

Reply via email to