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

RE: [XP] Mock Objects in a COM Web World

Expand Messages
  • Morris, Chris
    IMO, this is XP related ... I know I ll be heading off to more and more internet development in the next year or so -- and we re a MS shop at the moment, so
    Message 1 of 19 , Sep 1, 2000
      IMO, this is XP related ... I know I'll be heading off to more and more
      internet development in the next year or so -- and we're a MS shop at the
      moment, so I'm interested in anything related to COM testing...

      This is my last e-mail on this. Sorry to pollute your readers with non-XP
      mail!
    • art_thursland@tspb.com
      ... Why didn t you use VbUnit? It can test a COM object written in any language. Your testing strategy is fine if your COM objects don t instantiate other COM
      Message 2 of 19 , Sep 1, 2000
        Dick wrote:


        > We have written a test harness that instantiates COM objects and
        > exercises the methods. There is no test code in either the COM object
        > or in the application(s) that use it. Once the COM object tests
        > properly, it becomes a black box that other applications may be clients
        > for.

        Why didn't you use VbUnit? It can test a COM object written in any
        language.

        Your testing strategy is fine if your COM objects don't instantiate other
        COM objects. In the application I'm dealing with this isn't so. There
        have been some interesting suggestions generated from my initial question
        but for now I'm DTSTTCPW. I moved the code doing the CreateInstance to
        it's own method and create either a Mock Object or the real object
        depending on the value of a public boolean variable. (If someone sets
        MyObject.TestMode to True in the production code then they get what they
        deserve.) If it turns out that I need to generate a different Mock Object
        depending on the test then I'll add that functionality. Right now I don't
        need it.

        At first the fact that there was some code in the COM object to support
        testing bothered me. Now it doesn't. I think that's a good thing.

        Art
      • Baker, Bram
        I was thinking about that last night...And I suppose it is XP related, at least to the extent that I was describing a possible test technique. Given XP s
        Message 3 of 19 , Sep 1, 2000
          RE: [XP] Mock Objects in a COM Web World

          I was thinking about that last night...And I suppose it is XP related, at least to the extent that I was describing a possible test technique. Given XP's test-first philosophy, I think that any and all testing tricks are XP related.

          I suppose what I was referring to was me getting into the details of how one might implement the trick...but then again, I guess that's the point!

          <Chris Morris>IMO, this is XP related ... I know I'll be heading off to more and more
          internet development in the next year or so -- and we're a MS shop at the
          moment, so I'm interested in anything related to COM testing...</Chris Morris>

          <previous bram>
          This is my last e-mail on this. Sorry to pollute your readers with non-XP
          mail!</previous bram>


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

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

          Ad-free courtesy of objectmentor.com

        • wecaputo@thoughtworks.com
          ... least to the extent that I was describing a possible test technique. Given XP s test-first philosophy, I think that any and all testing tricks are XP
          Message 4 of 19 , Sep 1, 2000
            >I was thinking about that last night...And I suppose it is XP related, at
            least to the extent that I was describing a possible test technique. Given
            XP's test-first >philosophy, I think that any and all testing tricks are XP
            related.


            Writing Testable code is (as was pointed out in another post recently) one
            of the changes that XP brings to one's coding. Seeing as how I am trying to
            keep testFirst in my playbook, and I am writing COM code, I found this
            thread VERY relevant to the list, and not pollution at all.


            >I suppose what I was referring to was me getting into the details of how
            one might implement the trick...but then again, I guess that's the point!


            I think it was a very good technique, not simply a trick at all. FWIW I
            thought it a great idea. I am looking forward to trying it. and to any
            additional posts that follow on this thread about testing COM.


            There have been many implementation specfic examples of Java testing before
            on this list for example, and I found those helpful (and I am sure those
            participating felt they were quite relevant) so too I am sure there are
            others lurking here who are glad to see what you have learned about testing
            COM.


            Thanks Bram,


            Bill
          • Philip Craig
            I don t think it s pollution at all. If you are XPing in a Microsoft world, check out NetUnit at: http://www.xpdeveloper.com/cgi-bin/wiki.cgi?NetUnit Full
            Message 5 of 19 , Sep 1, 2000
              I don't think it's pollution at all.

              If you are XPing in a Microsoft world, check out NetUnit at:

              http://www.xpdeveloper.com/cgi-bin/wiki.cgi?NetUnit

              Full JUnit (bar the GUI) for .Net components.

              --- In extremeprogramming@egroups.com, "Morris, Chris" <ChrisM@S...>
              wrote:

              IMO, this is XP related ... I know I'll be heading off to more and
              more internet development in the next year or so -- and we're a MS
              shop at the moment, so I'm interested in anything related to COM
              testing...

              This is my last e-mail on this. Sorry to pollute your readers with
              non-XP mail!
            • rgams@core.com
              -- Original Message ----- From: art_thursland@tspb.com Date: Friday, September 1, 2000 9:33 am Subject: Re: RE: [XP] Mock Objects in a COM Web World ... We
              Message 6 of 19 , Sep 1, 2000
                -- Original Message -----
                From: art_thursland@...
                Date: Friday, September 1, 2000 9:33 am
                Subject: Re: RE: [XP] Mock Objects in a COM Web World

                >
                > Dick wrote:
                >
                >
                > > We have written a test harness that instantiates COM objects and
                > > exercises the methods. There is no test code in either the COM
                > object> or in the application(s) that use it. Once the COM object
                > tests> properly, it becomes a black box that other applications
                > may be clients
                > > for.
                >
                > Why didn't you use VbUnit? It can test a COM object written in any
                > language.
                >

                We could have used VBUnit or CppUnit - that we wrote our own framework
                had to do with other functionality we needed. The point is that we
                test the COM object by testing the interface - a black box test I guess.

                > Your testing strategy is fine if your COM objects don't
                > instantiate other
                > COM objects.

                I don't see why that makes a difference. We test each COM object
                individually. If it passes, it should be usable in other contexts
                without additional testing. The only thing we test at any time is the
                interface of the current object. The fact that this object is creating
                other COM objects seems irrelevant.

                Dick
              • art_thursland@tspb.com
                Dick wrote ... object. ... In the application I m working on there are business COM objects that create data access COM objects. There is also a lot of
                Message 7 of 19 , Sep 1, 2000
                  Dick wrote

                  > The only thing we test at any time is the interface of the current
                  object.
                  > The fact that this object is creating other COM objects seems irrelevant.

                  In the application I'm working on there are business COM objects that
                  create data access COM objects. There is also a lot of VBScript on the
                  Active Server Pages that shouldn't, in my opinion, be there. I'd like to
                  move as much of the VBScript as I can to an application facade COM object
                  so that I can test it. For a variety of reasons I want to test the
                  business COM objects without actually talking to the back end database. I
                  also want to test the application facade COM objects without talking to the
                  actual business objects. With your strategy the unit tests for the upper
                  layers become more like functional tests, since you're testing the whole
                  component hierarchy. It can also be difficult to generate an abnormal
                  condition in the lower level COM object that you might want to test for. I
                  think I can get better test coverage with my strategy. Time will tell.

                  Best Regards,

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