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

Re: [XP] Re: YAGDI You Are Gonna Debug It.

Expand Messages
  • Adam Sroka
    ... I think that is what he is saying. He s saying that a test failure should provide the same information that a log (or a debugger) would provide. But, if
    Message 1 of 31 , Jul 6, 2009
    • 0 Attachment
      On Sun, Jul 5, 2009 at 8:02 PM, p_jayadeep<p_jayadeep@...> wrote:
      >
      >
      > But IMO, your need for debugging goes down drastically for a code that is
      > developed with unit tests, may be the log messages that you write are the
      > ones that you need to verify with a unit test. That way you don't need to
      > manually inspect the errors, but the failing Unit Tests give you an
      > immediate feedback!
      >

      I think that is what he is saying. He's saying that a test failure
      should provide the same information that a log (or a debugger) would
      provide. But, if you are saying that the tests should be responsible
      for asserting the state rather than the objects being responsible for
      informing on it, then I share your same concern with what is being
      suggested.
    • Adam Sroka
      ... To my mind, YAGNI says that if I don t need it now I might as well assume that I will never need it. One of the main advantages of mocks is that they allow
      Message 31 of 31 , Jul 20, 2009
      • 0 Attachment
        On Mon, Jul 20, 2009 at 10:09 PM, Jeff Grigg<jeffgrigg@...> wrote:
        >
        >
        >>> --- kentb<kentb@...> wrote:
        >>>> I have almost no use for mocks. I think it's because
        >>>> I tend to write in a functional style.
        >
        >> --- Bill Caputo<list-subscriber@...> wrote:
        >>> I find myself faking/mocking in just three areas:
        >>> 1) Non-deterministic stuff (e.g. random number generators, dates)
        >>> 2) far-side of boundary stuff (e.g. databases, system calls, etc)
        >>> 3) complicated stuff that I don't want to write yet.
        >
        > --- Adam Sroka <adam.sroka@...> wrote:
        >> If we take YAGNI to it's logical extreme, don't most things
        >> reduce to #3?
        >
        > No, I don't think so. I use mocks for "nasty external things that are
        > difficult to control or test." So that would be #1 and #2 above. As for #3,
        > I just write it. It's needed to make the system work. It's needed to make
        > the functionality I'm working on right now work. Why wouldn't I write it
        > now?
        >

        To my mind, YAGNI says that if I don't need it now I might as well
        assume that I will never need it.

        One of the main advantages of mocks is that they allow me to speculate
        about the interface while deferring decisions about the
        implementation. Is it possible that I could know what message I need
        to send without knowing what the receiver should do in response?
        Because, if there is ever a time that that is true then using a mock
        makes sense.
      Your message has been successfully submitted and would be delivered to recipients shortly.