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

Re: [XP] Re: Writing new tests after refactoring

Expand Messages
  • Tim Ottinger
    Oh. Then don t do that. :-) If authorization is a matter of calling a previously-tested function, then all you have to do is make sure you re calling it
    Message 1 of 2 , Jul 22, 2007
    • 0 Attachment
      Oh. Then don't do that. :-)

      If authorization is a matter of calling a previously-tested function,
      then all you have to do is make sure you're calling it correctly.
      Then, when there is a case that does not delegate directly to
      the pre-tested is_superuser function, you can test the corner
      cases and be happy.

      I figure there should never be a test that adds zero value, as
      testing is_superuser from n places would add no value.

      Tim

      ----- Original Message ----
      From: Brian Victor <homeusenet3@...>
      To: extremeprogramming@yahoogroups.com
      Sent: Saturday, July 21, 2007 2:01:53 PM
      Subject: [XP] Re: Writing new tests after refactoring

      Tim Ottinger wrote:
      > The delegation is descriptive. I thought I said that. I thought you
      > were asking whether you should change the tests to use is_superuser or
      > keep them with can_perform_task. I understood the code, but not the
      > question. So I'm not sure what the question is.

      I'll rephrase then. My concern is that every time I test authorization
      on a class that refactors into is_superuser, I have to write the same
      three tests. That seems like a code smell to me. Is there a reason to
      keep duplicating those tests? My instinct is just to write one
      delegation test instead of three user tests.

      --
      Brian



      To Post a message, send it to: extremeprogramming@...

      To Unsubscribe, send a blank message to: extremeprogramming-unsubscribe@...

      ad-free courtesy of objectmentor.com
      Yahoo! Groups Links











      ____________________________________________________________________________________
      Choose the right car based on your needs. Check out Yahoo! Autos new Car Finder tool.
      http://autos.yahoo.com/carfinder/

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