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

RE: [TFUI] Re: [XP] TDDing Mac UIs

Expand Messages
  • Tony Milici
    I thought the last post went to both lists, but it didn t, so I have cross posted back to the XP list. ... the code repository ... a ... compare ... The ...
    Message 1 of 1 , Jul 31, 2003
    • 0 Attachment
      I thought the last post went to both lists, but it didn't, so I have
      cross posted back to the XP list.


      >-----Original Message-----
      >From: Phlip [mailto:plumlee@...]
      >Sent: Wednesday, July 30, 2003 7:13 PM
      >To: TestFirstUserInterfaces@yahoogroups.com
      >Subject: Re: [TFUI] Re: [XP] the team lead deleted [my unit tests] from
      the >code repository
      >
      >Tony Milici wrote:
      >
      >> The basic steps I follow are something like this (assuming straight
      >> Carbon):
      >>
      >> 1. Write a test that declares the dialog class. The test doesn't
      >> compile.
      >> 2. Write the (empty) dialog class.
      >>
      >> Now, assume we have a story that says the user must be able to enter
      a
      >> value into an edit field. Then,
      >>
      >> 3. In the test, construct the dialog and manually set the control's
      >> value, then call the GetEditFieldValue method (or whatever) and
      compare
      >> it to what you set. The test doesn't compile.
      >>
      >> 4. Write the GetEditFieldValue method and return an empty string.
      The
      >> test fails.
      >>
      >> 5. I you really want to do the simplest thing that could work you
      would
      >> now hard-code GetEditFieldValue to return exactly the value you set,
      >> which passes the test (but there is still no actual edit on the
      dialog).
      >> I usually skip this and go to
      >>
      >> 6. Make the dialog in Interface Builder and add the edit field to it.
      >> Implement GetEditFieldValue to return the edit field's value. The
      test
      >> now passes.
      >
      >Because you do not mention invoking the message pump, can we assume
      this
      >process implies you never see that window during testing?

      In this case I don't call the message loop, so the dialog doesn't
      display. However, calling a non-modal message loop and displaying the
      dialog is no big deal, but calling a modal loop is problematic because
      it blocks.

      >To look at the dialog really executing, do you compile the actual app?

      Yes.

      >(Note Tony's dialog box is not humble, because he does not mock it, or
      >delay
      >writing it. He uses the TDD rules to force himself to edit the dialog's
      >resource template.)

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