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

Re: [XP] Re: More on Unit Testing

Expand Messages
  • Keith Ray
    With c++ on ms windows and ui programming, I d try NOT writing any tests against purely ui code. If a ui-only bug shows up that isn t purely cosmetic, consider
    Message 1 of 11 , Mar 4, 2010
    • 0 Attachment
      With c++ on ms windows and ui programming, I'd try NOT writing any
      tests against purely ui code. If a ui-only bug shows up that isn't
      purely cosmetic, consider adding a test for that bit of the ui. I
      don't see much ROI for unit-testing GUI.

      If you export your app's functionality via COM, you can drive the
      application from a scripting language, and you can have app-level
      tests without ui sensitivity.

      C. Keith Ray
      Agile Coaching, training, eLearning
      http://www.industriallogic.com
      Sent from my iPhone

      On Mar 3, 2010, at 8:42 AM, "nyrb2" <ua485@...>
      wrote:

      > Thanks Klaus -- I bought the book and it's really helping a lot.
      > However, there's one big thing I'm struggling with. In order to do
      > the end-to-end "acceptance" tests the authors talk about, they
      > employ a Java open-source library called WindowLicker - a framework
      > for the test-driven development of Java systems through the GUI. It
      > does things like finding and controling Swing compenents,
      > synchronizing with Swing's threads and event queues, and wrapping
      > that all up behind a simple API which hooks into the unit testing
      > framework they'd chosen (I think it was JUnit).
      >
      > My problem is that I'm working in C++ in Visaul Studio, using a unit
      > test library called cppunit. I've looked but haven't found any
      > equivalent library like WindowLicker, meaning that I am going to
      > have to write all the GUI communication myself. I've been doing
      > that up till now, but it's extremely onerous (using windows calls
      > and handles to find the right controls etc.)
      >
      > Do you (or anyone else here) know of any library I can hook into
      > cppunit to do this processing automatically?
      >
      >
      > Bryn G.
      >
      >
      > --- In extremeprogramming@yahoogroups.com, Klaus Hebsgaard
      > <klaus@...> wrote:
      >>
      >> You should read the book called "Growing Object Oriented systems
      >> guided by
      >> tests" - I think it will answer many of your questions...
      >>
      >> In short do end to end testing first (formulated them as acceptance
      >> tests),
      >> and then in order for the end to end test to pass, tdd the
      >> functionality out
      >> with unit tests...
      >>
      >> Best regards
      >>
      >> Klaus Hebsgaard
      >>
      >> Website: http://www.hebsgaard.dk
      >> Blog: http://www.khebbie.dk
      >>
      >>
      >> On Fri, Feb 19, 2010 at 12:23 AM, nyrb2 <ua485@...>wrote:
      >>
      >>>
      >>>
      >>> Thank you so much for all your responses! As a developer, I find
      >>> the input
      >>> invaluable in trying to formulate a plan for testing and I
      >>> appreciate all
      >>> your collective years of experience.
      >>>
      >>> What are your thoughts on "end-to-end" tests? Tests that don't
      >>> examine the
      >>> operability of various pieces of a function, but test the entire
      >>> function as
      >>> a whole? Our software lead was pretty insistent that we write
      >>> these kind of
      >>> tests in addition to unit tests so that the functionality can be
      >>> placed into
      >>> an "automated test" framework. The problem is, as I said in my
      >>> previous
      >>> post, the prospect of writing an end-to-end test even for something
      >>> relatively simple such as this "delete" function is rather daunting.
      >>>
      >>>
      >>>
      >>
      >>
      >> [Non-text portions of this message have been removed]
      >>
      >
      >
      >
      >
      > ------------------------------------
      >
      > To Post a message, send it to: extremeprogramming@...
      >
      > To Unsubscribe, send a blank message to: extremeprogramming-unsubscribe@...
      >
      > ad-free courtesy of objectmentor.comYahoo! Groups Links
      >
      >
      >
    • Charlie Poole
      +1 on all except the COM part... 1. Test directly below the UI, but... 2. make the UI incredibly thin The Visual Studio IDE is your enemy here. Every time you
      Message 2 of 11 , Mar 5, 2010
      • 0 Attachment
        +1 on all except the COM part...

        1. Test directly below the UI, but...
        2. make the UI incredibly thin

        The Visual Studio IDE is your enemy here. Every time you click to
        create an event handler the IDE opens up a spot for you to add
        more code to the UI itself. Resist that temptation and call into
        your separate assembly that handles business logic.

        Simply doing this can take you a long way. At some point, you
        should look into using MVC or MVP rather than just MV.

        COM, in my view, should be reserved for interacting with legacy
        code that already uses it. Live is complicated enough already. :-)

        Charlie

        > -----Original Message-----
        > From: extremeprogramming@yahoogroups.com
        > [mailto:extremeprogramming@yahoogroups.com] On Behalf Of Keith Ray
        > Sent: Thursday, March 04, 2010 6:12 PM
        > To: extremeprogramming@yahoogroups.com
        > Cc: extremeprogramming@yahoogroups.com
        > Subject: Re: [XP] Re: More on Unit Testing
        >
        > With c++ on ms windows and ui programming, I'd try NOT
        > writing any tests against purely ui code. If a ui-only bug
        > shows up that isn't purely cosmetic, consider adding a test
        > for that bit of the ui. I don't see much ROI for unit-testing GUI.
        >
        > If you export your app's functionality via COM, you can drive
        > the application from a scripting language, and you can have
        > app-level tests without ui sensitivity.
        >
        > C. Keith Ray
        > Agile Coaching, training, eLearning
        > http://www.industriallogic.com
        > Sent from my iPhone
        >
        > On Mar 3, 2010, at 8:42 AM, "nyrb2" <ua485@...>
        > wrote:
        >
        > > Thanks Klaus -- I bought the book and it's really helping a lot.
        > > However, there's one big thing I'm struggling with. In order to do
        > > the end-to-end "acceptance" tests the authors talk about,
        > they employ
        > > a Java open-source library called WindowLicker - a
        > framework for the
        > > test-driven development of Java systems through the GUI. It does
        > > things like finding and controling Swing compenents, synchronizing
        > > with Swing's threads and event queues, and wrapping that
        > all up behind
        > > a simple API which hooks into the unit testing framework
        > they'd chosen
        > > (I think it was JUnit).
        > >
        > > My problem is that I'm working in C++ in Visaul Studio,
        > using a unit
        > > test library called cppunit. I've looked but haven't found any
        > > equivalent library like WindowLicker, meaning that I am
        > going to have
        > > to write all the GUI communication myself. I've been doing that up
        > > till now, but it's extremely onerous (using windows calls
        > and handles
        > > to find the right controls etc.)
        > >
        > > Do you (or anyone else here) know of any library I can hook into
        > > cppunit to do this processing automatically?
        > >
        > >
        > > Bryn G.
        > >
        > >
        > > --- In extremeprogramming@yahoogroups.com, Klaus Hebsgaard
        > <klaus@...>
        > > wrote:
        > >>
        > >> You should read the book called "Growing Object Oriented systems
        > >> guided by tests" - I think it will answer many of your questions...
        > >>
        > >> In short do end to end testing first (formulated them as
        > acceptance
        > >> tests), and then in order for the end to end test to pass, tdd the
        > >> functionality out with unit tests...
        > >>
        > >> Best regards
        > >>
        > >> Klaus Hebsgaard
        > >>
        > >> Website: http://www.hebsgaard.dk
        > >> Blog: http://www.khebbie.dk
        > >>
        > >>
        > >> On Fri, Feb 19, 2010 at 12:23 AM, nyrb2 <ua485@...>wrote:
        > >>
        > >>>
        > >>>
        > >>> Thank you so much for all your responses! As a developer,
        > I find the
        > >>> input invaluable in trying to formulate a plan for testing and I
        > >>> appreciate all your collective years of experience.
        > >>>
        > >>> What are your thoughts on "end-to-end" tests? Tests that don't
        > >>> examine the operability of various pieces of a function, but test
        > >>> the entire function as a whole? Our software lead was pretty
        > >>> insistent that we write these kind of tests in addition to unit
        > >>> tests so that the functionality can be placed into an "automated
        > >>> test" framework. The problem is, as I said in my previous
        > post, the
        > >>> prospect of writing an end-to-end test even for something
        > relatively
        > >>> simple such as this "delete" function is rather daunting.
        > >>>
        > >>>
        > >>>
        > >>
        > >>
        > >> [Non-text portions of this message have been removed]
        > >>
        > >
        > >
        > >
        > >
        > > ------------------------------------
        > >
        > > To Post a message, send it to: extremeprogramming@...
        > >
        > > To Unsubscribe, send a blank message to:
        > > extremeprogramming-unsubscribe@...
        > >
        > > ad-free courtesy of objectmentor.comYahoo! Groups Links
        > >
        > >
        > >
        >
        >
        > ------------------------------------
        >
        > To Post a message, send it to: extremeprogramming@...
        >
        > To Unsubscribe, send a blank message to:
        > extremeprogramming-unsubscribe@...
        >
        > ad-free courtesy of objectmentor.comYahoo! Groups Links
        >
        >
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.