views:

64

answers:

4

I am trying to learn how to use BDD for our development process and I sometimes end-up writing things that implies a UI design, so for brand new development or new features, the UI does not always exists.

For example, if I say this in a scenario "When a column header is clicked" it implies that this feature is based on some sort of table or grid, but at this point we are still just writing user-stories so there is no UI yet.

That gets me confused to know at what point in the process do we come up with a UI design ?

Keep in mind, I only have read articles about BDD and I think it would help our team a lot but still very new at this! Thx!

A: 

I guess you can write around that by saying "when I sort the information by X, then..." But then you would have to adjust your scenario to remove any mention of the data being displayed in a grid format, which could lead to some rather obtuse writing.

I think it's a good idea to start with UI design as soon as you possibly can. In the case you mentioned above, I think it would be perfectly valid to augment the user story with sketch of the relevant UI as you would imagine it, and then refine it as you go along. A pencil sketch on a piece of paper should be fine. Or you could use a tablet and SketchBook Pro if you want something all digital.

My point is that I don't see a real reason for the UI design to be left out of user stories. You probably already know that you're going to build a Windows, WPF, or Web application. And it's safe to assume that when you want to display tabular data, you'll be using a grid. Keeping these assumptions out of the requirements obfuscates them without adding any real value.

ShaderOp
A: 

User stories benefit from the fact, that you describe concrete interactions and once you know concrete data and behaviour of the system for it, you might as well add more information about the way you interact. This allows you to use some tools like Cucumber, which with Selenium enables you to translate a story to a test. You might go even further and e.g. for web apps capture all pages you start concrete story at and collect all interactions with that page resulting in some sort of information architecture you might use for documentation or prototyping and later UI testing.

On the other hand, this makes your stories somewhat brittle when it comes to UI changes. I think the agile way of thinking about this is same as when it comes to design changes - do not design for the future, do the simplest possible thing, in the future you might need to change it anyway.

If you stripped your user stories of all concrete things (even inputs) you will end up with use cases(at least in their simplest format, depends on how you write your stories). Use cases are in this respect not brittle at all, they specify only goals. This makes them resistant to change, but its harder to transfer information automatically using tools.

As for the process, RUP/UP derives UI from use cases, but I think agile is in its nature incremental (I will not say iterative, this would exclude agile methods like FDD and Kanban). This means, as you implement new story, you add to your UI what is necessary. This only makes adding UI specifics in stories more reasonable. The problem is, that this is not a very good way to create UI or more generally UX(user experience). This is exactly what one might call a weakpoint of agile. The Agile manifesto concentrates on functional software, but that is it. There are as far as I know no agile techniques for designing UI or UX.

Gabriel Ščerbák
Kanban is iterative. It just has very short iterations not of a fixed length.
Don Roby
There are lots of Agile techniques, just not so many methodologies. I particularly like Agile tools like pens and paper. The conversation technique also works well for me.
Lunivore
@donroby as I understand the "iterative" part of iterative incremental software development lifecycle, iterations are time boxed and sequential. In FDD and Kanban as I understand there is that pull system, which means you develop the feature (or the smallest marketable feature) as you have nothing else to do, so there is no sequence, it is concurrent for every developer (or pair) and there is no time limit (planned ahead, maybe estimated, but not planned). This is in my opinion very different from what I understand as iterative incremental and the difference is very important imho
Gabriel Ščerbák
@Gabriel - Words are difficult and sometimes irrelevant. While I agree that timeboxing is usually a good idea, it just isn't part of the word 'iterative' to me. Sorry I bothered with the comment, as I really don't think it makes a useful point in retrospect.
Don Roby
@donroby no, I think it is a good thing you mentioned it, now I can question my understanding and look it up somewhere to get it right, thank you.
Gabriel Ščerbák
+1  A: 

If you write your scenarios with a focus on the capabilities of the system, you'll be able to refactor the underlying steps within those scenarios more easily. It keeps them flexible. So I'd ask - what does clicking the column get for you? Are you selecting something? What are you going to do with the selection? Are you searching for something and sorting by a value?

I like to see scenarios which say things like:

  • When I look for the entry
  • When I go to the diary for January
  • When I look at the newest entries
  • When I look at the same T-shirt in black

These could all involve clicking on a column header, but the implementation detail doesn't matter. It's the capability of the system.

Beneath these high-level scenarios and steps I like to create a screen or page with the smaller steps like clicking buttons in it. This makes it easy to refactor.

I wrote this in a DSL rather than English, but it works with the same idea - you can't tell from the steps whether it's a GUI or a web page, and some of the steps involve multiple UI actions:

http://code.google.com/p/wipflash/source/browse/Example.PetShop.Scenarios/PetRegistrationAndPurchase.cs

Hope you find it interesting and maybe it helps. Good luck!

Lunivore
A: 

I think you just need to step back a bit.

BAD: When I click the column header, the rows get sorted by the column I clicked.

GOOD: Then I sort the rows by name, or sometimes by ZIP code if the name is very common, like "Smith".

A user story / workflow is a sequence of what the user wants to achieve, not a sequence of actions how he achieves that. You are collecting the What's so you can determine the best How's for all users and use cases.


Looking at a singular aspect of your post:

if I say this in a scenario "When a column header is clicked" it implies that this feature is based on some sort of table or grid, but at this point we are still just writing user-stories so there is no UI yet.

If this came from a user, not from you, it would show a hidden expectation that there actually is a table or grid with column headers. Even coming from you it's not entirely without value, as you might be a user, too. It might be short-sighted, thinking of a grid just because it comes from an SQL query, or it might be spot-on because it's the presentation you expect the data in. A creative UI isnÄt a bad thing as such, but ignoring user expectations is.

peterchen
So what you're saying in short is that the ability to sort the rows is more a 'result' of a scenario... basically it means that it's telling me I need to code something that will allow sorting the rows so that the user can 'assert' let's say "Ok I can sort the rows: checked."
SBUJOLD
I am not yet happy with the word "result", but yes, that's what I want to say. "sorting by X" is *what* the user wants to do, "clicking the column header" is only the *how* he will do it. In a user scenario you want to collect the *what*s, so you can later determine the best *how*'s
peterchen
I've edited the wording a bit.
peterchen