views:

1441

answers:

3

hi there

I m just starting using gwt and so far so good, however after reading some sample code I wonder is it necesary to have a high level of test coverage? (I can see that most code is declarative and then add some attributes I can see the sense in checking so me particular attributes are there but not all)

Also i would be interested to know anything about what are the gotchas in TDDing with GWT

I m using eclipse so also if you are really happy with some particualrs add ins for GWT I would be happy to hear about that Thanks for the input

edit: maybe I m asking a very wide question, but even little pieces of information will help I come from having nvelocity views with jquery/extJs/prototype/scriptaculous and this is a bit different

+1  A: 

I think you asked a pretty broad question, which is part of the reason why you didn't get a reply for a while.

Compared to traditional AJAX web development, one could argue a GWT application requires less testing. Because the GWT team has worked so hard to make sure that its widgets work consistently across all web browsers, you don't have to worry about cross-browser compatibility nearly as much for your own application.

That frees you up to focus on your own application. Create a separate test case for each of your own custom widgets and test that they behave as you expect, and then write higher-level tests for each module. Take the extra step to make your tests fully automatable - that way every time you make a change or are about to release, it's easy to run all of your tests.

http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=google-web-toolkit-doc-1-5&t=DevGuideJUnitIntegration

dmazzoni
+2  A: 

When designing GWT applications to be easily testable, it's best to move as much logic out of the view as possible. Use a design pattern which makes GUI testing easier such as Model-View-Presenter (MVP), which is used widely in building desktop applications (The C#/.NET folks have written a lot about this pattern.)

You can use GWTTestCases to test remote communication and code that ultimately executes raw JavaScript (most of the GWT core classes require this, especially widgets). However, these tests are slow to execute, so you should prefer designs which put all that logic in objects that can be tested in plain ol' JUnit TestCases.

For more information about writing GWT applications test-first, I've written an article for Better Software magazine, which is available as a PDF online at my blog.

+2  A: 

I think the best reference at the moment would be this Testing Methodologies Using Google Web Toolkit

Iker Jimenez