Behaviour-Driven Development (BDD) with Google Web Toolkit (GWT)

- Martin Mauch

Here at crealytics, we are developing a very interesting Rich Internet Application (RIA) using the Google Web Toolkit (GWT) with a REpresentational State Transfer (REST) Server. We use Behaviour-Driven Development (BDD) for outside-in development driven by business value. BDD for web apps is usually a good fit, as several testing tools support Javascript. As we do not have a specialist for GUI design yet, we have decided to use a Model-View-Presenter (MVP) pattern and start testing at the presenter level (outside) down to the server (in). This combination proves to be harder than expected as most Javascript testing tools work on the UI level by clicking on links, filling forms etc.

Right now we are using Cuke4Duke for story- or acceptance-tests to drive the overall implementation and use Scala Specs for unit testing. Both tools do not provide any means to run in a GWTTestCase and can therefore only test pure Java parts of the application. This is not too big a problem for the unit tests, as only view classes (which should be very slim using MVP) and a few classes concerning client-server connections and JSON parsing must be tested otherwise. The real problem is, that our integration tests in Cuke4Duke can not test the correctness of the entire application, especially that the  integration of  classes works. We are considering writing GWT generators which take Cuke4Duke stories and generate corresponding GWTTestCases that can test the entire stack in Javascript.

During the next months I will go into more detail on the application we develop and the technologies we use to create the maybe best software for managing SEM campaigns known to man 😉


Martin is developing a bid management solution for crealytics. He is also a long-term meditator and interested in neuro-feedback.

    Find more about me on:
  • twitter


Leave a Reply

Your email address will not be published. Required fields are marked *