Loading ...
Sorry, an error occurred while loading the content.

Re: [XP] Creating new bugs when fixing old ones...

Expand Messages
  • Matt Secoske
    ... So far I have only done simple things like TicTacToe to get my head around the process. I am struggling a bit to in certain scenarios: forgetting to get
    Message 1 of 84 , Aug 1, 2005
    • 0 Attachment
      On 8/1/05, Ron Jeffries <ronjeffries@...> wrote:
      >
      > On Monday, August 1, 2005, at 8:15:44 AM, Matt Secoske wrote:
      >
      > > I have always seen debugging as an iterative process. You fix a bug and
      > > potentially find a bug/s. With TDD, (something I am just now getting my
      > head
      > > around) I would imagine that there are still times when you need to
      > invoke
      > > the debugger and walk through the code. However, I would image that this
      > > happens quite a bit later in the process than in a code-fix
      > environement, as
      > > you have the tests to back you up.
      >
      > Today, I consider it a "failure" if I need to use the debugger. I
      > try to push a bit to find ways to find out what I need to know
      > without it. Those ways usually entail writing a test.
      >
      > I find that when I do TDD in tiny steps, I "need" the debugger far
      > less often, primarily because my code comes out much simpler than it
      > used to, and because I test each code branch as I write it, rather
      > than later, if at all.
      >
      > > So, you fix a bug an break 20 tests... at least you know that they are
      > > broke, instead of having to run the code through any number of
      > machinations
      > > to "test" it. Is this how you have seen TDD work?
      >
      > Well, yes ... but I think that I also see that breaking many tests
      > happens, not because the code is complex, but because the initial
      > change was bad for any purpose. My TDD'd code is much more modular,
      > and generally speaking, changes tend to be localized and not to have
      > wide-spread effects.
      >
      > Can you sense similar things happening when you TDD?


      So far I have only done "simple" things like TicTacToe to get my head around
      the process. I am struggling a bit to in certain scenarios: forgetting to
      get my red bar before coding the green, writing too much code for one test,
      etc. However, I have taken a program I wrote years back and rewritten it
      using TDD, and tried to ignore the fact that I had already written it once,
      though I did end up with a similar approach to the data structures, etc. I
      would say that the TDD code turned out much better than the prior code. It
      was simple, succint, and expressed my intentions for the code perfectly,
      without the extra baggage that the older code had.

      Ron Jeffries
      > www.XProgramming.com <http://www.XProgramming.com>
      > If you want to garden, you have to bend down and touch the soil.
      > Gardening is a practice, not an idea.
      > -- Thich Nhat Hanh
      >


      --
      Matt Secoske
      http://www.secosoft.net


      [Non-text portions of this message have been removed]
    • Cory Foy
      ... If your group is anything like mine here in Charlotte, don t use the example from the JUnit site. The group almost missed the point of the demo from trying
      Message 84 of 84 , Aug 5, 2005
      • 0 Attachment
        Matt Secoske wrote:
        > Your right it does. I have one person who has started to write tests for his
        > code (not test first - we'll get there). I am continuing to push, and am
        > coming up with other examples... hopefully more persuasive than the first
        > one. I also am presenting TDD at the next Java Users Group meeting here in
        > Omaha, so if you have any thoughts or examples that I could use I would
        > appreciate it. I have read Ron's bolwing example, and have the TicTacToe
        > example that I have adopted from a presentation by Dr. Venkat Subramaniam I
        > recently attended.

        If your group is anything like mine here in Charlotte, don't use the
        example from the JUnit site. The group almost missed the point of the
        demo from trying to figure ways *they* would have handled different
        currencies. ;) That's what I get for running a JUG in a banking town...

        Cory
      Your message has been successfully submitted and would be delivered to recipients shortly.