in Search

cruizer

aspiring to free and open the mind of .NET developers

March 2007 - Posts

  • A test-first demo on the web

    While I was mulling over what to demo for test-first development here in this blog, I chanced upon this CodeProject article.

    What do you think about this? Actually the same problem was the one I demoed in my previous MSDN Connection events for Microsoft Philippines some months back. I've gotten tired of the problem, and I appreciate the inputs of those here who commented that there is a need to demo something that's more real-world than converting numbers into English words. In my TDD experience I've noticed that TDD is not a good thing to use in developing algorithms. TDD is, in my observation, a tool that's better put to use in determining class designs and interactions. Maybe I can demo this particular observation too.

    Anyway if you have ideas on what real-world situation and/or requirement would be cool to demo, I'm all for it. Just send a comment here or drop me an email. Just remove the "spamMeNot" from the email address.
    Posted Mar 29 2007, 01:32 PM by cruizer with 4 comment(s)
    Filed under: , ,
  • Test first, or test after?

    I posted a thread at the msforums.ph site regarding this question to get a feel of how developers feel about testing. So far there have been only a few replies.

    When I first encountered test-driven development, I knew it would be helpful to learn this technique. What threw me off, of course, was the notion of doing tests first, even before you write the class code. It was very different from what I have learned, from learning programming on my own and in my past work environments. Struggle I did -- sometimes I ended up writing tests after (to validate my code); many times I ended up not writing tests at all. Good luck running that code in production... Stick out tongue

    It's only now that I am realizing the benefits of doing test-first development. The hard part is always the beginning: what test shall I write first? Many times I realize that my difficulty is due to my tendency to jump the gun and focus on what classes I want to create and what methods and properties they should have. I've found that it is helpful to relax and think first of what the class should do and how the consuming code can call it. I start with a small feature. It's even helpful not to think of the class but to think of what it should be able to accomplish.

    I hope to be able to come up with a demo of how to do things test first in a few days. Stay tuned. If time permits I will even make it a video demo.