1

I'm trying to figure out which use cases should I put in my use case diagram. I'm developing a poll webapp: after login, an authenticated user can browse a list of polls, then may select one poll from the list and finally may answer a poll.

This is what I made.

enter image description here

I'm in doubt with the extend relationship, is that correct or I should separate all these use cases without the extend relationship?

qwerty_so
  • 35,448
  • 8
  • 62
  • 86
  • If you are satisfied with one of the answers, please mark it as accepted. It would give the author some credit points. If you are not satisfied, please explain why. – www.admiraalit.nl Sep 16 '19 at 11:18

2 Answers2

0

No, that's just wrong. You are starting functional decomposition. You don't do that during a use case synthesis. There is just one use case here: Browse questions. This is the one bringing added value to the actor. The other ones are steps in a scenario described inside the use case.


As always I recommend to read Bittner/Spence about use cases.

qwerty_so
  • 35,448
  • 8
  • 62
  • 86
  • Thanks for the answer. I thought that "answer poll", beeing a functional requirement of the system, was a use case also. So if I have another functional requirement, such as "post comments" on polls, it's the same thing? Also, can you please show how you write a scenario that describes the use case "browse questions" considering that the user may "answer poll" and "post comment" ? Thank you very much –  Sep 11 '19 at 19:38
  • You probably need to look into the book I recommended. You might as well google for "Cockburn Use Case" since he published quite a bit about noting use case scenarios. Generally: a use case shows the added value, no scenario steps! – qwerty_so Sep 11 '19 at 20:17
0

Every use case should let the actor achieve some goal, so that, at the end of the use case, the actor can say: "I'm finished".

In my opinion, the best use case is "Answer poll". The actor's goal is to give his/her opinion.

"Browse questions" could also be a use case: the goal is satisfying the actor's curiosity: "See what questions there are." But this is arguable.

I don't see any added value for the actor in use case "Select question". It seems to me that this is just a required step towards answering the poll. I would eliminate this use case. Selecting a question is a step in the flow of steps of use case "Answer poll".

Now suppose we keep two use cases: "Browse questions" and "Answer poll". What relationship would these two use cases have, include or extend?

Personally, I would use an include relationship. It's more natural to say that answering a poll includes browsing the questions than to say that answering a poll is an extended way of browsing the questions. But an include will only be possible if the complete use case "Browse questions" can be inserted at a single point in use case "Answer poll" (typically at the start of "Answer poll"). This may not be the case in your situation. Maybe you want to let the actor return to "Browse questions" after having answered a poll, for example to execute some final steps specified in "Browse questions". In that case, an extend relationship can be used.

If you opt for an include relationship, then don't forget to draw an association between the actor and "Answer poll".

A minor remark to end with: extend and include should be written completely in lowercase.

www.admiraalit.nl
  • 5,768
  • 1
  • 17
  • 32
  • The cross with OMG's definition is that a UC _specifies a set of behaviors [...] which yields an observable result that is of value_ while "extending UCs" add _some additional behavior_ using the same notation. So that's were you start breaking down things (functional decomposition). Honestly, that's just crap. Those OMG guys are pure techies. It's just in their blood to break things into pieces. From my POV include/extend should just be dumped. – qwerty_so Sep 12 '19 at 00:02