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

Simplicity or Automated testing

Expand Messages
  • David Corbin
    I m working on an Eclipse plugin. At one particular point of integration, I m having to go a lot of effort in order to be able to TDD a certain concept. I ve
    Message 1 of 6 , Jan 1, 2004
    • 0 Attachment
      I'm working on an Eclipse plugin. At one particular point of integration, I'm
      having to go a lot of effort in order to be able to TDD a certain concept.
      I've introduced two additional interfaces, and I'm having to mock (EasyMock,
      in this case) 4 different objects for this particular tests. It's becoming
      very complex, rather than simple, all because thiis particular portion of the
      framework is structured the way it is. I've probably spent more than five
      hours refactoring and writing new code for a feature I *think* I could have
      reliably written and (tested by hand) in 30 minutes. And I'm still not done.

      So the question is, do you ever give up on automated testing in order to keep
      things simple? How do you judge when to do that?

      Thanks
      --
      David Corbin <dcorbin@...>
    • Ron Jeffries
      ... I do it when I can t see how to test something. I usually regret it, as it takes longer than I think. The situation you re describing does sound too
      Message 2 of 6 , Jan 1, 2004
      • 0 Attachment
        On Thursday, January 1, 2004, at 10:05:42 AM, David Corbin wrote:

        > I'm working on an Eclipse plugin. At one particular point of integration, I'm
        > having to go a lot of effort in order to be able to TDD a certain concept.
        > I've introduced two additional interfaces, and I'm having to mock (EasyMock,
        > in this case) 4 different objects for this particular tests. It's becoming
        > very complex, rather than simple, all because thiis particular portion of the
        > framework is structured the way it is. I've probably spent more than five
        > hours refactoring and writing new code for a feature I *think* I could have
        > reliably written and (tested by hand) in 30 minutes. And I'm still not done.

        > So the question is, do you ever give up on automated testing in order to keep
        > things simple? How do you judge when to do that?

        I do it when I can't see how to test something. I usually regret it, as it
        takes longer than I think.

        The situation you're describing does sound too complex, but since y ou're
        locked in to how Eclipse works, there might be no way around it.

        If you decide just to code it and test it by hand ... let us know what
        happens. If you don't ... it sounds like publishing what you have done, and
        how, would be useful to the Eclipse community!

        Ron Jeffries
        www.XProgramming.com
        It's easier to act your way into a new way of thinking
        than to think your way into a new way of acting. --Millard Fuller
      • David Corbin
        ... Thanks for the input. ... Well, it is part of an open source project, and one focused on TDD (which makes the irony very painful). So, it will be
        Message 3 of 6 , Jan 1, 2004
        • 0 Attachment
          On Thursday 01 January 2004 10:11, Ron Jeffries wrote:
          > On Thursday, January 1, 2004, at 10:05:42 AM, David Corbin wrote:
          > > I'm working on an Eclipse plugin. At one particular point of
          > > integration, I'm having to go a lot of effort in order to be able to TDD
          > > a certain concept. I've introduced two additional interfaces, and I'm
          > > having to mock (EasyMock, in this case) 4 different objects for this
          > > particular tests. It's becoming very complex, rather than simple, all
          > > because thiis particular portion of the framework is structured the way
          > > it is. I've probably spent more than five hours refactoring and writing
          > > new code for a feature I *think* I could have reliably written and
          > > (tested by hand) in 30 minutes. And I'm still not done.
          > >
          > > So the question is, do you ever give up on automated testing in order to
          > > keep things simple? How do you judge when to do that?
          >
          > I do it when I can't see how to test something. I usually regret it, as it
          > takes longer than I think.
          >
          > The situation you're describing does sound too complex, but since y ou're
          > locked in to how Eclipse works, there might be no way around it.
          >

          Thanks for the input.

          > If you decide just to code it and test it by hand ... let us know what
          > happens. If you don't ... it sounds like publishing what you have done, and
          > how, would be useful to the Eclipse community!
          >

          Well, it is part of an open source project, and one focused on TDD (which
          makes the irony very painful). So, it will be "published". But I'm not
          sure that it's general enough (or a good enough design (or large enough)) to
          make a "project" out of it. OTOH, I do think I'll raise the issue of
          untestablity with the appropriate Eclipse group.

          --
          David Corbin <dcorbin@...>
        • J. B. Rainsberger
          ... Yes, I do. I m doing it now. I m regretting it now. Obviously, I don t know how to judge when to do it. -- J. B. Rainsberger, Diaspar Software Services
          Message 4 of 6 , Jan 1, 2004
          • 0 Attachment
            David Corbin wrote:

            > I'm working on an Eclipse plugin. At one particular point of integration, I'm
            > having to go a lot of effort in order to be able to TDD a certain concept.
            > I've introduced two additional interfaces, and I'm having to mock (EasyMock,
            > in this case) 4 different objects for this particular tests. It's becoming
            > very complex, rather than simple, all because thiis particular portion of the
            > framework is structured the way it is. I've probably spent more than five
            > hours refactoring and writing new code for a feature I *think* I could have
            > reliably written and (tested by hand) in 30 minutes. And I'm still not done.
            >
            > So the question is, do you ever give up on automated testing in order to keep
            > things simple? How do you judge when to do that?

            Yes, I do. I'm doing it now.

            I'm regretting it now.

            Obviously, I don't know how to judge when to do it.
            --
            J. B. Rainsberger,
            Diaspar Software Services
            http://www.diasparsoftware.com :: +1 416 791-8603
            Let's write software that people understand
          • Dossy
            ... What s the difference in how you re trying to automate your tests vs. how you d test by hand? Presumably, the difference is that you re trying to automate
            Message 5 of 6 , Jan 1, 2004
            • 0 Attachment
              On 2004.01.01, David Corbin <dcorbin@...> wrote:
              > I've probably spent more than five hours refactoring and writing new
              > code for a feature I *think* I could have reliably written and (tested
              > by hand) in 30 minutes. And I'm still not done.

              What's the difference in how you're trying to automate your tests vs.
              how you'd test by hand?

              Presumably, the difference is that you're trying to automate unit tests
              and testing by hand is functional testing. I find that when I feel pain
              trying to automate unit tests, it's because I'm testing units that are
              far too big. If I can't figure out how to code smaller units, I just
              write one large functional test and let it test "everything" ... and
              those are pretty easy -- I just write scripts that automate exactly what
              I would have done by hand if I were testing manually.

              -- Dossy

              --
              Dossy Shiobara mail: dossy@...
              Panoptic Computer Network web: http://www.panoptic.com/
              "He realized the fastest way to change is to laugh at your own
              folly -- then you can let go and quickly move on." (p. 70)
            • Asim Jalis
              ... It s hard to say without knowing the details of your situation. There is always a risk of giving up on testing too early. Maybe there is a simpler solution
              Message 6 of 6 , Jan 1, 2004
              • 0 Attachment
                David Corbin <dcorbin@...> wrote:
                > I'm working on an Eclipse plugin. At one particular point of
                > integration, I'm having to go a lot of effort in order to be
                > able to TDD a certain concept. I've introduced two additional
                > interfaces, and I'm having to mock (EasyMock, in this case) 4
                > different objects for this particular tests. It's becoming
                > very complex, rather than simple, all because thiis particular
                > portion of the framework is structured the way it is. I've
                > probably spent more than five hours refactoring and writing new
                > code for a feature I *think* I could have reliably written and
                > (tested by hand) in 30 minutes. And I'm still not done.
                >
                > So the question is, do you ever give up on automated testing in
                > order to keep things simple? How do you judge when to do that?

                It's hard to say without knowing the details of your situation.
                There is always a risk of giving up on testing too early. Maybe
                there is a simpler solution out there. A simpler way to code the
                feature so that it is testable, or a simpler way to test the
                existing code.

                Can you describe your problem in general terms?

                One idea might be to take a walk, think about the problem, talk
                to yourself, scribble on paper, see if another solution is
                possible.

                Maybe you are mocking too much. Why not just hit the real thing
                with your tests?

                I'd love to hear more about the problem.


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