When you are developing a complex application, be it web, mobile or whatever, it’s useful to be able to launch any screen immediately and independently from the rest of the system. By “screen” I mean a web page, an Android activity, a Swing component, or whatever it is called in the UI technology that you are using. For instance, in an ecommerce application, I would like to be able to immediately show the “thank you for your purchase” page, without going through logging in, adding an item to the cart and paying.
The benefits of this simple idea are many:
- You can easily demo user stories that are related to that screen
- You can quickly test UI changes
- You can debug things related to that page
- You can spike variations
- The design of the screen is cleaner and less expensive to maintain.
The way out of this problem is to decouple the screen from its data sources. In a web application, I would launch a screen by going to a debug page that allows me to set up some test data, and then launch the page. For instance:
Note that the form starts pre-populated with default data, so that I can launch the desired screen with a single click.
Making screens decoupled from their data sources does, in my opinion, generally improve the design of the application. Making things more testable has a general positive impact on quality.