How to Generate Activity Diagram from User Story?

In the world of agile, a user story can be used to record a user's problem or concern to be addressed by the system to be developed. During the discussion of user story, project team can write down the suggested usage of the system in the form of scenarios. Each scenario is a set of steps a user will take to achieve what they want, under that user story. With user story scenario, user can read and confirm if the system flow is what they preferred before the commencement of feature development.

April 29, 2016
Views: 59,830
PDF Download
For stakeholders and the project team to read the steps more easily, you can optionally generate a UML activity diagram from the scenario to visualize the steps. In this tutorial, we will write a simple user story and then generate an activity diagram from it. User story to activity diagram

Writing a User Story Scenario

  1. Create a new project with Visual Paradigm. Select Project > New from the application toolbar.
  2. In the New Project window, enter Online Shopping as the project name. Click the Create Blank Project button.
    New Project window
  3. Open the User Story page in UeXceler. If UeXceler is not already open, select UeXceler > UeXceler from the application toolbar and then open the User Story page.
    Open user story page
  4. Create a general user story. Click on Add a feature that can... and enter User can add an item to shopping cart. as the name.
    User story created
  5. Double-click on the user story to open it.
  6. Open the Scenario page.
    Open Scenario page
  7. Enter the steps to accomplish this user story. Click on the first step and enter Open an item page.
    Enter step
  8. Press Enter and enter step 2: Select attributes (e.g. appearance, style).
    Enter step two
  9. A quantity box will be displayed when the item the user selected is still available for purchase. Let's write an if-then-else for this. Press Enter to go to the third step, then press Ctrl+Space to toggle the Statement Control list.
    Statement Control list toggled
  10. Select If from the Statement Control list.
    Select If
  11. Enter out of stock.
    If condition filled
  12. Let's say the system will display an 'out of stock' message in this situation. Press Enter to go into the `if` condition, then press Ctrl+Space again.
  13. This step is performed by the system. Let's create a System Response. Select System Response from the Statement Control list.
    Select System Response
  14. Enter Display "Out of stock" message.
    Entered System Response
  15. A quantity box will be displayed in the 'else' case. Now, press Enter and press Ctrl+Space to toggle the Statement Control list.
  16. Select Change to Else from the Statement Control list.
    Change to 'Else'
  17. Press Enter.
  18. Toggle the Statement Control list by pressing Ctrl+Space. Select System Response from the list and enter Show quantity box.
    System Response entered
  19. Press the Down arrow key to go to the 'end if'. Then, press Enter to go to step 5.
  20. The customer will then enter the quantity of the item and add the item to the cart. Enter Enter quantity and Click "Add to Cart" as steps 5 and 6, respectively.
    Steps entered
  21. Once the item is added to the cart, the system will prompt if the customer wants to continue shopping. Press Enter to create a new step. Enter the system response Prompt "Do you want to continue shopping?" as step 7.
    System Response entered
  22. If the customer has chosen "Yes", the system will then reopen the item page. Use the Statement Control list to add an `if` condition: has chosen "Yes".
    Added 'if'
  23. Press Enter to go into the `if` condition. Press Ctrl+Space to toggle the Statement Control list. This time, select Jump.
    Select Jump
  24. Click on the tiny arrow button next to step 1 to represent jumping to step 1.
    Select step

Generating an Activity Diagram from a User Story

We have just completed the scenario. Let's generate a UML activity diagram from it. Select Synchronize to Diagram > Synchronize to Activity Diagram from the toolbar.

Synchronize to Activity Diagram

A UML activity diagram is generated from the scenario in seconds.

Activity Diagram generated

If necessary, press Ctrl+Tab to go back to the user story.