Story-driven modeling


Story-driven modeling is an object-oriented modeling technique. Other forms of object-oriented modeling focus on class diagrams.
Class diagrams describe the static structure of a program, i.e. the building blocks of a program and how they relate to each other.
Class diagrams also model data structures, but with an emphasis on rather abstract concepts like types and type features.
Instead of abstract static structures, story-driven modeling focuses on concrete example scenarios and on how the steps of the example scenarios
may be represented as object diagrams and how these object diagrams evolve during scenario execution.

Software development approach

Story-driven modeling proposes the following software development approach:
  1. Textual scenarios: For the feature you want to implement, develop a textual scenario description for the most common case. Look on only one example at a time. Try to use specific terms and individual names instead of general terms and e.g. role names:
  2. : Scenario Go-Dutch barbecue
  3. *Start: This Sunday Peter, Putri, and Peng meet at the park for a go-Dutch barbecue. They use the Group Account app to do the accounting.
  4. *Step 1: Peter brings the meat for $12. Peter adds this item to the Group Account app.
  5. *Step 2: Putri brings salad for $9. Peter adds this item, too. The app shows that by now the average share is $7 and that Peng still have to bring these $7 while Peter gets $5 out and Putri gets $2 out.
  6. *Step 3:...
  7. GUI mock-ups: To illustrate the graphical user interface for the desired feature, you may add some wireframe models or GUI mock-ups to your scenario:
  8. : Scenario Go-Dutch barbecue
  9. *Start: This Sunday Peter, Putri, and Peng meet at the park for a go-Dutch barbecue. They use the Group Account app to do the accounting.
  10. *Step 1: Peter brings the meat for $12. Peter adds this item to the Group Account app.
  11. *Step 2: Putri brings salad for $9. Peter adds this item, too. The app shows that by now the average share is $7 and that Peng still have to bring these $7 while Peter gets $5 out and Putri gets $2 out:
  12. *Step 3:...
  13. Storyboarding: Next, you think about how a certain situation, i.e. a certain step of a scenario may be represented within a computer by a runtime object structure. This is done by adding object diagrams to the scenario. In story driven modeling, a scenario with object diagrams is also called a storyboard.
  14. : Scenario Go-Dutch barbecue
  15. *Start: This Sunday Peter, Putri, and Peng meet at the park for a go-Dutch barbecue. They use the Group Account app to do the accounting.
  16. *Step 1: Peter brings the meat for $12. Peter adds this item to the Group Account app.
  17. *Step 2: Putri brings salad for $9. Peter adds this item, too. The app shows that by now the average share is $7 and that Peng still have to bring these $7 while Peter gets $5 out and Putri gets $2 out:
  18. *Step 3:...
  19. Class diagram derivation: Now it is fairly straightforward to derive a class diagram from the object diagrams used in the storyboards.

    Note, the class diagram serves as a common reference for all object diagrams. This ensures that overall the same types and attributes are used. Using a UML tool, you may generate a first implementation from this class diagram.
  20. Algorithm design: So far you have modeled and implemented that object structures that are deployed in your application. Now you need to add behavior, i.e. algorithms and method bodies. Programming the behavior of an application is a demanding task. To facilitate it, you should first outline the behavior in pseudocode notation. You might do this, e.g. with an object game. For example, to update the saldo attributes of all persons you look at our object structure and from the point of view of the GroupAccount object you do the following:
  21. : Update the saldo of all persons:
  22. * visit each item
  23. ** for each item add the value to the total value and add 1 to the number of items
  24. * compute the average share of each person by dividing the total value by the number of persons
  25. * visit each person
  26. ** for each person reset the saldo
  27. ** for each person visit each item bought by this person
  28. *** for each item add the value to the saldo of the current person
  29. ** for each person subtract the share from the saldo
  30. Behavior implementation: Once you have refined your algorithm pseudocode down to the level of operations on object structures it is straightforward to derive source code that executes the same operations on your object model implementation.
  31. Testing: Finally, the scenarios may be used to derive automatic JUnit tests. The pseudocode for a test for our example might look like:
  32. : Test update the saldo of all persons:
  33. * create a group account object
  34. * add a person object with name Peter and a person object with name Putri and a person object with name Peng to the group account object
  35. * add an item object with buyer Peter, description Meat, and value $12 to the group account object
  36. * add an item object with buyer Putri, description Salad, and value $9 to the group account object
  37. * call method update the saldo of all persons on the group account object
  38. * ensure that the saldo of the Peter object is $5
  39. * ensure that the saldo of the Putri object is $2
  40. * ensure that the saldo of the Peter object is -$7
  41. * ensure that the sum of all saldos is $0

    Summary

Story driven modeling has proven to work very well for the cooperation with non IT experts. People from other domains usually have difficulties to describe their needs in general terms and general rules. Similarly, normal people have problems to understand pseudocode or to judge, whether their needs are properly addressed or not. However, these people know their business very well and with the help of concrete examples and scenarios it is very easy for normal people to spot problematic cases and to judge whether their needs have been addressed properly.
Story Driven Modeling has matured since its beginning in 1997. In 2013 it is used for teaching e.g. in Kassel University, Paderborn University, Tartu University, Antwerp University, Nazarbayev University Astana, Hasso Platner Institute Potsdam, University of Victoria,...