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
      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
      >> 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
      >> it to what you set. The test doesn't compile.
      >> 4. Write the GetEditFieldValue method and return an empty string.
      >> test fails.
      >> 5. I you really want to do the simplest thing that could work you
      >> now hard-code GetEditFieldValue to return exactly the value you set,
      >> which passes the test (but there is still no actual edit on the
      >> 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
      >> now passes.
      >Because you do not mention invoking the message pump, can we assume
      >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?


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

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