On May 7, 2006, at 10:48 PM, Jeremy Tregunna wrote:

>
>> Jim Freeze wrote:
>>> Try unit testing for a while and you will see. After doing
>>>   1) write code
>>>   2) write test
>>>   3) run test and see it succeed
>>>
>
> Perhaps it's me, but it doesn't make much sense to write your code  
> BEFORE your test. How do you know that the code is operating right  
> if you write it before your test?

Yes. that is what I was trying to point out. Maybe I didn't succeed.
Most people do 1,2,3; 1,2,3; 1,2,3. If they are lucky and no tests
break, then they go back to one of the previous three iterations
and break 1 then run 3, see it fail, and say to themselves, "ok, my
tests are working",  go back, fix 1, and continue on.

It is best to do the following:
   1) write test
   2) run test and see it fail
   3) write code
   4) run test and see it succeed (hopefully) :)


Jim Freeze