On Jul 22, 2:46 am, Kwhit <[email protected]> wrote:
> * I dropped the idea of using HasClickHanders, HasValues, ... in favor
> of methods like getPassword(), and addSignInClickHandler() in the
> Viewer interface. I think it's a very elegant idea but it doesn't sit
> well with EasyMock and I prefer tested code to elegant code and don't
> think I loose much

I think this is an important point.  By exposing the low-level
HasClickHandlers, HasValues, etc. interfaces you have to write very
"chatty" tests, and using mock objects to do this requires a lot of
set up of expectations.  For testing widgets like a Phone Number
editor (in Ray's example) this level of coverage may be desirable, but
for a presenter for a larger screen, it may be unmanageable.

So it seems it's a tradeoff in how much test coverage you need --
expose the low-level HasXyz interfaces in your view if you need more
automated test code coverage, or use a gateway interface to the view
which exposes higher-level methods like getPassword().  Using this
gateway means you lose test coverage of which specific widgets are
wired to a given Presenter callback, but you may be able to live with
that risk (a quick manual exploratory test might give you that
confidence).

Martin Fowler talks a little bit about this in his MVP writings -- see
the page below, starting with this paragraph "One of the prime reasons
to use Supervising Controller is for testability..."
http://martinfowler.com/eaaDev/SupervisingPresenter.html

Dan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to