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

RE: [agile-usability] How do you unit test web interfaces?

Expand Messages
  • Desilets, Alain
    ... I don t really want to argue about the definition of unit vs acceptance testing. I agree with you that testing which requires deployment sucks, especially
    Message 1 of 22 , Apr 25, 2007
      > Desilets, Alain wrote:
      > > But I think testing the behaviour of a single web page
      > (including the
      > > behaviour of it's embedded JavaScript code) fits the definition of
      > > unit testing.
      >
      > It fits *some* definitions of unit testing, but not the one I
      > generally use. I generally use the TDD concept of unit
      > testing, rather than the ones generally accepted by the
      > testing community. I don't call anything "unit testing" if
      > it requires deployment to run.

      I don't really want to argue about the definition of unit vs acceptance testing.

      I agree with you that testing which requires deployment sucks, especially if it's manual deployment. I'm looking for tools and techniques that will allow me to do automated testing (whether it be unit or acceptance) of the GUI without requiring too much in the way of deployment. It seems to me that testing the embedded javascript should be possible without full deployment. For example, invoke the script that generates the HTML containing that javascript, then load that HTML into some kind of browser emulator that has a JavaScript interpretor, etc... Dunno if that exists or not.


      ----
      Alain Désilets, MASc
      Agent de recherches/Research Officer
      Institut de technologie de l'information du CNRC /
      NRC Institute for Information Technology

      alain.desilets@...
      Tél/Tel (613) 990-2813
      Facsimile/télécopieur: (613) 952-7151

      Conseil national de recherches Canada, M50, 1200 chemin Montréal,
      Ottawa (Ontario) K1A 0R6
      National Research Council Canada, M50, 1200 Montreal Rd., Ottawa, ON
      K1A 0R6

      Gouvernement du Canada | Government of Canada
    • Desilets, Alain
      ... Thx Brian. I ll have a look. ... Right. When I test non-web GUIs, that s the approach I use. Except that contrarily to Mike, I don t use a MockView. I find
      Message 2 of 22 , Apr 25, 2007
        > I have something of an example here, using the Atomic
        > Object's variant of
        > whatever-Martin-Fowler-calls-Model/View/Presenter-these-days:
        >
        > <http://www.testing.com/cgi-bin/blog/2007/01/05#wireframe2>
        > <http://www.testing.com/cgi-bin/blog/2007/01/11#wireframe3>
        > <http://www.testing.com/cgi-bin/blog/2007/01/18#wireframe4>
        >
        > This example assumes a non-HTML app, but I plan to repurpose
        > it to HTML to show that's tractable. (Haven't started that
        > yet.) The idea of MVP (note: different than MVC) is to make
        > the view very thin and put all the view smarts ("when text is
        > entered in this text box, make that button visible") into a
        > layer below it. The first link is to a movie that explains
        > the Atomic Object style, which uses the Observer pattern heavily.

        Thx Brian. I'll have a look.

        >
        > See also Mike Feather's "Humble Dialog Box":
        > <http://www.objectmentor.com/resources/articles/TheHumbleDialo
        > gBox.pdf>

        Right. When I test non-web GUIs, that's the approach I use. Except that contrarily to Mike, I don't use a MockView. I find it's just as easy to test using the actual graphical view. And doing it that way catches all sort of silly little bugs in the view. Things like a button not being properly wired to the model method it's supposed to invoke.

        I haven't figured out how to do this in a web context though, hence my post.


        ----
        Alain Désilets, MASc
        Agent de recherches/Research Officer
        Institut de technologie de l'information du CNRC /
        NRC Institute for Information Technology

        alain.desilets@...
        Tél/Tel (613) 990-2813
        Facsimile/télécopieur: (613) 952-7151

        Conseil national de recherches Canada, M50, 1200 chemin Montréal,
        Ottawa (Ontario) K1A 0R6
        National Research Council Canada, M50, 1200 Montreal Rd., Ottawa, ON
        K1A 0R6

        Gouvernement du Canada | Government of Canada
      • George Dinwiddie
        ... If you want to test just the javascript, put it in a .js file and test it with jsUnit. -- ... * George Dinwiddie *
        Message 3 of 22 , Apr 25, 2007
          Desilets, Alain wrote:
          > I agree with you that testing which requires deployment sucks,
          > especially if it's manual deployment. I'm looking for tools and
          > techniques that will allow me to do automated testing (whether it be
          > unit or acceptance) of the GUI without requiring too much in the way
          > of deployment. It seems to me that testing the embedded javascript
          > should be possible without full deployment. For example, invoke the
          > script that generates the HTML containing that javascript, then load
          > that HTML into some kind of browser emulator that has a JavaScript
          > interpretor, etc... Dunno if that exists or not.

          If you want to test just the javascript, put it in a .js file and test
          it with jsUnit.

          --
          ----------------------------------------------------------------------
          * George Dinwiddie * http://blog.gdinwiddie.com
          Software Development http://www.idiacomputing.com
          Consultant and Coach http://www.agilemaryland.org
          ----------------------------------------------------------------------
        Your message has been successfully submitted and would be delivered to recipients shortly.