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

Re: [XP] how much to unit test function that calls well-tested functions?

Expand Messages
  • Ken Boucher
    ... This struck me as incredibly funny because it s actually the reason I write unit tests only flipped around. I consider 99% of my unit tests worthless. The
    Message 1 of 60 , Sep 3, 2008
    • 0 Attachment
      --- In extremeprogramming@yahoogroups.com, "John A. De Goes" wrote:

      > Some years ago in the gaming industry, it was well-known that most
      > titles lost money, and those costs were born by the occasional
      > blockbuster (I believe this is still true in the movie industry).
      > A very lucky win can cover your losses. Sometimes I wonder if many
      > software development companies survive on the same principle.
      > Produce crap at full steam ahead. Most of the times the project
      > will end badly, but occasionally you'll get lucky and save a
      > bundle. Enough to make up for the losses? Perhaps, since many chop
      > shops don't have to maintain the crap they produce.

      This struck me as incredibly funny because it's actually the reason I
      write unit tests only flipped around.

      I consider 99% of my unit tests worthless. The code that passes them I
      probably would have written anyway or something so similar that it
      doesn't really matter.

      That being said, the 1% of my unit tests that have value have such
      value that they more than make up for my typing in the other 99%.

      The problem is that I don't I don't know in advance which 1% I need
      because everyone I know seems to make mistakes randomly, including me.

      ...
      A monk asked Tozen when he was weighing some flax, "What is Buddha?"
      Tozen said, "This flax weighs three pounds.
      ...

      I'm nowhere near as enlightened as Tozen. He remained focused on doing
      what he was doing, which was weighing flax. But I'm not that perfect,
      and that's why I write unit tests. When we make a mistake I want us to
      find out nice and early, not sometime in the middle of the night.
    • John A. De Goes
      Yes, but in the case of a competition, there is no change. It s truly a write-once, throwaway scenario, for which there is no investment to protect. Regards,
      Message 60 of 60 , Sep 13, 2008
      • 0 Attachment
        Yes, but in the case of a competition, there is no change. It's truly
        a write-once, throwaway scenario, for which there is no investment to
        protect.

        Regards,

        John A. De Goes
        N-BRAIN, Inc.
        http://www.n-brain.net
        [n minds are better than n-1]

        On Sep 13, 2008, at 9:59 AM, Marty Nelson wrote:

        > > > Let's hold a contest, where the winner is the first one to
        > complete
        > > > the assignment. The assignment is to write a program that prints
        > > > "Hello World". You code a solution with TDD, and I'll code the
        > > > solution with "print "Hello World";"
        > >
        > > > Which one of us will win the competition?
        >
        > To show how horrible wrong even a hello world app can go(and assume
        > this is .NET, not sure how other languages handle this), imagine that
        > for v2 of the app, our customers are raving for it to
        > say "Hello\Goodbye World".
        >
        > So TDD is not just about the solution, but protecting that investment
        > against change...
        >
        >
        >



        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.