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

Re: [XP] binary search, test first, by intention

Expand Messages
  • Mike Clark
    ... Excellent point. If rangeNotEmpty had been more complex such that you feared going too long without the binsrch test passing, would you have written an
    Message 1 of 7 , Jun 1, 2002
    • 0 Attachment
      Ron Jeffries wrote:

      >
      >Well ... I have a pattern that sounds similar. I get better objects if
      >I start "top down" or "breadth first".
      >
      >However, since I try to practice YAGNI, I /cannot/ write rangeNotEmpty
      >or midrange first. So I don't have quite the same reaction to the
      >forces that you describe here ...
      >

      Excellent point.

      If rangeNotEmpty had been more complex such that you feared going too
      long without the binsrch test passing, would you have written an
      individual test for rangeNotEmpty? Maybe that's more depth first.

      Lately I've been listening for tests that break encapsulation in the
      name of testability. It's usually a result of trying to individually
      test methods like rangeNotEmpty that are already being tested through
      binsrch. To your point, it's also a result of not practicing YAGNI.

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