Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have a number of user stories where the same feature needs to be shared by multiple roles. I have started writing these stories like this:

As a Role-A or a Role-B
When I perform Action-X
Event-Y should occure.

Is this the correct way to represent that concept in user stories, or should I break it up into one story for each role?

share|improve this question

3 Answers 3

up vote 8 down vote accepted

Break It Up

one role per story; by forcing you to consider each role in isolation you may find differences appear naturally

[an example might help; there may be some role confusion taking place of roles A and B share a lot of the same stories; chances are there is a role C that 'owns' the common stories instead]

share|improve this answer
    
Thanks for the answer. That does make things a little clearer. What if the feature is something like a report. The report would have the same functionality for Role-A and Role-B, but Role-A and Role-B would still need to have different permissions within the system. –  Sean Hunter May 11 '11 at 6:36
    
@Sean re-examine your role definitions. If the different permissions within the system for role-A and role-B do not affect the report then they are irrelevant, and it seems likely that A and B are not the correct roles for the report story. For example, role-Architect and role-Manager both have access to the 401K Report. Would it not make more sense to define "401K Participant" as a more appropriate role for this report? –  Steven A. Lowe May 11 '11 at 7:44
    
Yeah that makes sense I get where you are coming from now. Thanks for the good advice :D. –  Sean Hunter May 11 '11 at 11:23

I agree with @Steven. You should either break the story or you should introduce generalization to roles. That means that you will have generalization of A and B which will be used every time the story is the same for both A and B. (It is like inheritance of roles / actors where generalization is parent of A and B).

share|improve this answer
1  
If you agree with Steven, why didn't you simply upvote him rather than adding another identical answer? –  pdr May 11 '11 at 9:59
1  
@pdr: I don't think that second part of my answer is "identical" and I upvoted Steven's answer. There is no rule that you cannot extend answers posted by others. That is up to community to judge that and upvote answers they like. As you can see Steven got more upvotes which is fair so I don't see any problem with my answer. –  Ladislav Mrnka May 11 '11 at 10:34
    
@pdr I agree with Ladislav's addition, and upvoted his answer too. The more good info the better! –  Steven A. Lowe May 11 '11 at 17:18

You need to identify and abstract out roles

The example you provided...

As a Role-A or a Role-B 
When I perform Action-X 
Event-Y should occure.

doesn't scale because there are an exponential number of combinations that the program could take.

To extract individual roles, you need to imagine the steps from a first-hand perspective while ignoring the global state.

I highly suggest you take a look at 'How to get a cup of coffee'. It demonstrates how a REST API for a coffee shop can be modeled using state diagrams.

The point is, you won't be able to draw an accurate picture of how the system interacts globally until you can see it working at a local level.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.