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

The joy of TDD

Expand Messages
  • jeff_olfert
    I really enjoy working in a TDD style, and am wondering how I might spread the fun to the rest of my team. Some of my team mates like to write tests after
    Message 1 of 8 , Aug 7 10:07 PM
    • 0 Attachment
      I really enjoy working in a TDD style, and am wondering how I might
      spread the fun to the rest of my team. Some of my team mates like to
      write tests after implementing the design. This is the way I use to
      work in the past, but afer being inroduced to TDD, I will never turn back.

      Any advice on spreading the joy of TDD with my team?
    • Phlip
      ... I call second dibs on the book title /The Joy of TDD/. -- Phlip http://c2.com/cgi/wiki?ZeekLand
      Message 2 of 8 , Aug 7 10:17 PM
      • 0 Attachment
        jeff_olfert wrote:

        > I really enjoy working in a TDD style, and am wondering how I might
        > spread the fun to the rest of my team. Some of my team mates like to
        > write tests after implementing the design. This is the way I use to
        > work in the past, but afer being inroduced to TDD, I will never turn back.
        >
        > Any advice on spreading the joy of TDD with my team?

        I call second dibs on the book title /The Joy of TDD/.

        --
        Phlip
        http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!
      • Adrian Howard
        On 8 Aug 2006, at 06:07, jeff_olfert wrote: [snip] ... [snip] If you can pair ping-pong development is awful fun.
        Message 3 of 8 , Aug 8 12:19 AM
        • 0 Attachment
          On 8 Aug 2006, at 06:07, jeff_olfert wrote:
          [snip]
          > Any advice on spreading the joy of TDD with my team?
          [snip]

          If you can pair ping-pong development is awful fun.

          <http://www.stickyminds.com/sitewide.asp?
          Function=edetail&ObjectType=COL&ObjectId=9101>

          Adrian
        • Charlie Poole
          Hi Jeff, ... Most programmers I know love to solve tricky intellectual puzzles. Arrange a brown-bag session where you introduce the TDD game. Think of a
          Message 4 of 8 , Aug 8 12:43 AM
          • 0 Attachment
            Hi Jeff,

            > I really enjoy working in a TDD style, and am wondering how I
            > might spread the fun to the rest of my team. Some of my team
            > mates like to write tests after implementing the design.
            > This is the way I use to work in the past, but afer being
            > inroduced to TDD, I will never turn back.
            >
            > Any advice on spreading the joy of TDD with my team?

            Most programmers I know love to solve tricky intellectual puzzles.

            Arrange a brown-bag session where you introduce the TDD "game." Think of a
            problem to be worked on test-first. Make a short (I repeat short)
            presentation on what TDD is all about. Present the problem - I like
            tic-tac-toe. Elicit suggestions for a test list and put them on the board.
            Get people to pick a test, write it and write the simplest possible code to
            make it pass.

            As folks work, walk around and find those people who are writing code not
            justified by their tests. Depending on your group's social norms, you can
            give them a quiet suggestion, mock them publicly or do something in between.


            It's an advantage to get people laughing at their own habits. I remember the
            guy who wrote a test to ensure that a new game board was empty and then
            implemented it using two hashtables. It got a great laugh and caused
            everyone to start discussing the problems that arise when you try to think
            too far ahead. And I didn't even have to tell them that, I just said "You
            need two hashtables to return zero? Wouldn't one be enough?"

            Let them discover for themselves the little things like returning null or
            zero to fake a test - that's why your presentation should be short. After
            they decide that TDD is cool and fun, you can look at its more serious side
            in a future discussion.

            Charlie
          • Ron Jeffries
            Hello jeff_olfert, Thanks for your email. On Tuesday, August 8, 2006, at 1:07:40 AM, ... Pair programming? Ask them to come help you on something, and let them
            Message 5 of 8 , Aug 8 3:42 AM
            • 0 Attachment
              Hello jeff_olfert,

              Thanks for your email. On Tuesday, August 8, 2006, at 1:07:40 AM,
              you wrote:

              > I really enjoy working in a TDD style, and am wondering how I might
              > spread the fun to the rest of my team. Some of my team mates like to
              > write tests after implementing the design. This is the way I use to
              > work in the past, but afer being inroduced to TDD, I will never turn back.

              > Any advice on spreading the joy of TDD with my team?

              Pair programming?

              Ask them to come help you on something, and let them see how you
              work?

              Ron Jeffries
              www.XProgramming.com
              The fact that we know more today, and are more capable today,
              is good news about today, not bad news about yesterday.
            • Cory Foy
              ... I second Charlie s idea of a short presentation on it. You want to find a sweet spot where you can use TDD to drive out a solution to a problem in a short
              Message 6 of 8 , Aug 8 5:35 AM
              • 0 Attachment
                jeff_olfert wrote:
                > Any advice on spreading the joy of TDD with my team?

                I second Charlie's idea of a short presentation on it. You want to find
                a sweet spot where you can use TDD to drive out a solution to a problem
                in a short manner.

                For example, the bowling game that Ron talks about has some very
                interesting problems - mainly look-ahead scoring. Being able to
                implement just straight scoring, and then introduce spares seems to get
                a lot of aha moments to the people I show it to. In fact, in a recent
                demo we barely made it into making the test pass for the first spare
                test, because a lot of people "got it" and wanted to talk more about the
                implications of that.

                Outside of that, hopefully the code you are writing is clearer, has less
                bugs, and is easier to change than theirs. It's a tough sell if they
                still feel their code is superior to yours.

                --
                Cory Foy
                http://www.cornetdesign.com
              • Phlip
                ... http://tinyurl.com/zl37c That seems to say that one pair writes the test case and the other pair writes the code to pass the test. If so, then that
                Message 7 of 8 , Aug 8 7:10 AM
                • 0 Attachment
                  Adrian Howard wrote:

                  > If you can pair ping-pong development is awful fun.
                  >
                  > <http://www.stickyminds.com/sitewide.asp?
                  > Function=edetail&ObjectType=COL&ObjectId=9101>

                  http://tinyurl.com/zl37c

                  That seems to say that one pair writes the test case and the other
                  pair writes the code to pass the test.

                  If so, then that converts the dichotomy of test-first into a competition.

                  The dichotomy is that the test side and code side have different
                  motivations. When writing a test you are expressing your intent as an
                  interface, inputs, and outputs. When writing code, you make the
                  stoopidest change possible to pass the test. That, in turn, forces you
                  to write more test to upgrade the code.

                  So the competition between elegance and simplicity can indeed form a
                  competition between pairs!

                  I wouldn't ping-pong forever, though...

                  --
                  Phlip
                  http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!
                • David Bogus
                  ... Why wouldn t you? -- Dave s Definitions: Morning, is after I ve slept for more than four hours. Lunch is the second meal of the day no matter the hour of
                  Message 8 of 8 , Aug 9 6:14 AM
                  • 0 Attachment
                    > I wouldn't ping-pong forever, though...
                    Why wouldn't you?


                    --
                    Dave's Definitions: Morning, is after I've slept for more than four
                    hours. Lunch is the second meal of the day no matter the hour of
                    consumption. A long drive is one longer then you have last slept.
                    Ineffable, if you don't understand I couldn't possibly explain it.
                  Your message has been successfully submitted and would be delivered to recipients shortly.