Adam Schuck of the Google Wave team spoke at Google I/O 2009 about building the Wave client using Google Web Toolkit (GWT). You can watch a video of the presentation online: Google Wave: Powered by GWT. The Google Wave client is a great demonstration of what's possible with GWT -- and what's coming in GWT 2.0.
One of Adam's key points was that automated testing is crucial to the project's success. You can watch this section of the presentation starting at around 46:30.
One of Adam's slides lists the Wave team's testing strategies:
- Use the Model View Presenter pattern to build testable client code. This pattern decouples widget code from user interface logic.
- Prefer JUnit test cases over GWTTestCases, since JUnit test cases run a few orders of magnitude faster than GWTTestCases. This means developers will be more likely to run the tests frequently.
- Use an end-to-end browser testing tool like WebDriver to verify the whole system. Adam emphasized making these tests as clear and readable as possible so that other developers can understand their intent.
If you'd like to learn more about testing GWT applications, here are some articles I've written on the subject:
- Google Web Toolkit: Writing Ajax Applications Test First demonstrates using the Model View Presenter pattern and discusses JUnit tests versus GWTTestCases. This article was adapted and included in the GWT online documentation.
- Mocking GWT widgets with GWTMockUtilities describes how to write plain ol' JUnit tests to test code which manipulates GUI components.
- Testing JSON parsing using JavaScript Overlay Types in GWT 1.5 shows how to test JavaScript Overlay Types, the Wave team's preferred way of mapping JSON messages to objects.
- Strategies for Testing GWT Widgets and View Components provides some suggestions for testing custom UI components.
Paul Infield-Harm and I will be presenting "Agile AJAX: The Google Web Toolkit Experience" at the Agile 2009 conference in Chicago, IL, where we'll demonstrate how to use GWT to build and test applications in an Agile process.
Comments
You can follow this conversation by subscribing to the comment feed for this post.