My posts from a couple years ago about building testable components for Google Web Toolkit with MVP are still fairly popular, they still drive a fair amount of traffic. GWT applications that I built in that era still use MVP, and while it certainly made those applications testable, the cost in boilerplate code and maintainability is high.
In the meantime, however, there were significant improvements in test frameworks that could disarm GWT widgets, making them testable without using the very slow GWTTestCase. If I were starting a new Google Web Toolkit application right now, I would be much more inclined to take this approach as the primary approach for building testable GWT applications.
Unsurprisingly, others have gone down this path. There's a pretty accessible presentation from Google I/O 2013 that talks about these different approaches for testing in GWT, Demystifying MVP and EventBus in GWT:
The first half of this presentation discusses some of the styles, the uses of MVP, and the alternative approach of building testable views by disarming the GWT widgets. It's pretty easy to follow, and in addition, the presentation briefly introduces gwtmockito, a framework for making it slightly easier to use mockito and GWT together for testable composite views.
While I haven't spent a lot of time with this approach and I haven't yet tried the framework, this matches very closely the path I would be inclined to explore with a new GWT application, so it feels like it's a step in the right direction at the very least.
If you're building applications in Google Web Toolkit, or considering a significant refactoring of an existing project, it's well worth watching.
Saturday, May 18, 2013
Testable Google Web Toolkit Composites with gwtmockito
tags:
google,
google io,
google io 2013,
google web toolkit,
GWT,
testability,
testing
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment