Archive for the ‘Software Engineering’ Category

Test driven development for GWT UI code with asynchronous RPC

Tuesday, April 22nd, 2008

In my previous blog post I we saw a test-driven approach to GWT UI code. This was based on moving logic to a Supervising Controller.
In this follow-up post we’ll turn our attention to interacting with RPC, and see how this can be tested using EasyMock. This involves some tricks and non-trivial boilerplate code, but fortunately most of this can be hidden by introducing convenience methods, and we end up with tests that are expressive and easy to read.
This article continuous on the sample code in my previous blog post, but if you’re just interested in the RPC part you can probably skip that and start from here. Familiarity with EasyMock basics is assumed.

(more…)

Test driven development for GWT UI code

Sunday, March 9th, 2008

Is a test driven development (TDD) approach possible when creating a GUI using GWT? This post is about how to apply MVC (Model-View-Controller) to organize GWT UI code, with these objectives:

  1. a clear separation of the controller logic from presentation and model
  2. full testability of the controller logic independent of the (browser or hosted mode) GWT environment.

We will see how this can be realized by adding a few simple classes to the standard set of GWT widgets, and applying an MVC flavor described by Martin Fowler as Supervising Controller.
The sample code shows how tests can provide a programmatic alternative for tests you would otherwise have to perform manually by interacting with the UI of the deployed application.

(more…)

Optimizing startup time for GWT hosted mode

Friday, November 30th, 2007

When developing GWT (Google Web Toolkit) applications, the GWT hosted mode is an invaluable tool, as it allows for short development cycles. Whenever you change something in the GWT client code and hit the “Refresh” button it will compile the change, reload the application and show the result of my change almost immediately. In theory, that is…
As soon as the GWT client code grows in size, it takes longer and longer to refresh, to the point that it becomes unacceptable.
In this blog I’ll explore this issue, discuss its causes and what you can do about it.

(more…)