Wednesday, July 27, 2011

Solving Problems vs. Creating Solutions

A common problem with software development is that the solutions we create often don't really fit the targeted problem.

In a posting about domain language - Whose domain is it anyway? -, Dan North provides a couple of "story" examples that illustrate how a simple change in thinking can ensure that a solution fits a problem.

Example 1 - a solution-based approach:
Given an unauthenticated user
When the user tries to navigate to the welcome page
Then they should be redirected to the login page
When the user enters a valid name in the Name field
And the user enters the corresponding password in the Password field
And the user presses the login button
Then they should be directed to the welcome page


Example 2 - a problem-based approach:
Given an unauthenticated user
When the user tries to access a restricted asset
Then they should be directed to a login page
When the user submits valid credentials
Then they should be redirected back to the restricted content


In the first example, the focus - pages, fields, buttons - is narrow and all about the implementation of a solution.

The second example is more abstract and is focused on the problem to be solved. The benefit here is that this problem will stand on its own regardless of how it is implemented, which can change over time.

No comments: