Model-Driven Use Case Analysis with Structured Scenarios
In this webinar you will learn how to:
Mr Ben Constable, Senior Analyst at Sparx Systems, explores Enterprise Architect's Structured Scenario Editor for model-driven use case analysis:
Explore the example Use Case Model
|We have provided a copy of the Enterprise Architect model that was used in the webinar.|
|Example Model: use-case-analysis-structured-scenarios.eap|
Questions from the AudienceClick on a question to see the answer.
What version of Enterprise Architect did you use in this presentation?
Enterprise Architect 10, Build 1008.
What editions of Enterprise Architect support structured scenarios and what is the minimum version required?
All editions other than EA Lite. In EA Lite (the free, read-only viewer) you can view structured scenarios but not edit them.
The Structured Specification Editor was introduced with the release of Enterprise Architect version 8.
Where is the Scenarios & Rules window? I don't see it in my copy of Enterprise Architect.
In Enterprise Architect 10 or later, the Scenario and Rules window is available from the menu: Element | Scenarios & Rules.
In earlier versions, use the menu: View | Scenarios & Requirements.
Can we have a copy of the model used for this presentation?
Yes. You can download it from this page.
Note: The download project file may be set as 'read-only'. If so, use the Windows' File Properties dialog to turn off the 'read-only' flag.
Where can I find webinars on the other subjects on your site? Where can I find previous webinars?
Is it possible to exchange the Use Case model with XML?
Yes. You can export and import Use Case models, including their structured scenarios, via XMI. Most third-party tools are unlikely to read the structured scenario information as it is not specifically defined in the XMI specification. However, the information can be round-tripped across Enterprise Architect projects.
Can changes to structured scenarios be baselined and audited to allow roll-back?
Yes. You can create baselines for a Package, then use Enterprise Architect's Baseline Comparison feature to view and roll-back changes. In the Baseline Comparison window, you will see the structured scenario changes under the node of the Use Case element's scenario. Enterprise Architect's Model Auditing feature also records and displays changes to structured scenarios. (You cannot use the audit trail to roll back changes) The following Help topics, may be of interest:
Can Enterprise Architect allow a BA to associate UI mock-ups with each Use Case scenario?
Yes. You could use one of Enterprise Architect's User Interface design profiles to create screens appropriate to each scenario. Then link the Screen element to the scenario using the Context References tab in the Structured Specification editor. See the Help topic User Interface Models.
General question on training. Where can one find training for learning Enterprise Architect?
You can select your region to find Sparx Systems Training Partners in your area.
(Note: While we endeavor to make our webinars informative and helpful to our users, we do not view these 30-minutes sessions as a substitute for the expert-led training programs offered by Sparx Systems Training Partners.)
Editing Structured Scenarios
What are the prerequisite constructs for using the Structured Specification Editor? That is, what do you have to do first?
You only need have a Use Case element in your model. For this webinar's example project, we predefined models of formal requirements (with feature elements and business rules) and a domain model. We did this to help expose the traceability aspects of the Structured Specification Editor, but these models are not prerequisites to creating structured scenarios.
I am using EA 10.0.1005. I cannot see the "Link to existing elements" option [context menu item in the Structured Specification tab]. Do we need to upgrade?
No. Double-click in the Uses or Results column for a given step. Then right-click to invoke the context menu. You should see the option available.
Note: The Specification Editor has two editing modes. First, when you select a step (but have not clicked in one of the cells) you will get a context menu that operates at the 'step level'. If you then click on a specific cell within that step, you have a context menu that is appropriate for the cell - it is this context menu that contains the Link to existing elements option for the Uses and Results columns.
Can a sub Use Case be included in the Structured Specification Editor (in case there is an Include relationship)?
Yes. In the Use Case step that includes another, simply right-click the appropriate step and choose:
Link Step to Use Case | «include» Use Cases.
The step text will be replaced with the Use Case name prefixed with «include». If the Include relationship does not already exist, it will be created and the included Use Case will be added to the list of Context References.
In the figure below, we show what our ATM Banking System Use Case diagram would be like if we used Include relationships to encapsulate the customer authentication steps.
Is it possible to add an alternate path to an alternate path? (i.e. 'nesting')
Not currently, but we understand the request and have forwarded it to the Development team for consideration. Also note: Some practitioners prefer to keep scenarios simple and avoid nested Alternate Paths using the Extends relationship.
If you'd like to send us your thoughts on this, we'd welcome your input on: firstname.lastname@example.org
How do I import flows from Microsoft Word into a structured Use Case scenario?
Copying and pasting via the clipboard is probably easiest, as explained in the Help topic Structured Specification Item Context Menu.
When using the Structured [Specification] Editor, did Ben enter the step numbers (e.g. 4a) or did EA number them automatically? If automatically, then could there be some confusion as the Use Cases are refined and the steps and alternate path steps become re-numbered?
The steps, including Alternate Path steps, are numbered by Enterprise Architect automatically. The step number for an Alternate Path is determined by the step you have selected in the Basic Path when creating the Alternate Path. If you reorder steps in the Basic Path, Enterprise Architect will automatically adjust the corresponding step numbers, including the associated Alternate Path steps.
In the Structured Specification, I presume the links in the actions are because those items are defined in the glossary? Or can they be any other element type?
The hyperlinks in the actions steps can refer to any glossary term, or any other element defined in the Context References tab.
How are quality factors included; i.e. performance parameters or constraints in a scenario step?
Perhaps use the Constraints tab to add a performance-related constraint, if it applies to the Use Case in general. (You could define a 'Performance' constraint type via: Settings | Project Types | General Types | Constraints)
If the performance parameters or constraint are specific to the scenario step, add them to the Uses column. If they are encapsulated in a model element - say, a non-functional requirement - then link to that element via the Uses column.
Generating Diagrams from Scenarios
Can Enterprise Architect generate a BPMN diagram, in place of the Activity diagram you showed?
No. Currently BPMN is not supported by the Structured Specification Editor as a target diagram type. We've added this to the requests from the webinar.
Do you generate Sequence diagrams from structured scenarios?
Yes. Sequence diagrams are supported by the Structured Specification Editor. However, you would need to represent the system as an element to get the appropriate Lifelines and the full picture. This is discussed in the Help topic Generated Sequence Diagram.
Can you generate a Use Case [scenario] from an Activity diagram (as opposed to an Activity diagram from a Use Case)?
Yes. You can reverse engineer an Activity diagram into a structured scenario. See the Help topic Generate Scenario From Activity Diagram. Note: You are restricted in which Activity diagrams you can select - it must be one that the Structured Specification Editor has generated before. You could, however, replace the contents of that diagram, or otherwise update it, before reverse engineering the structured scenario.
We saw how to generate Activity diagrams from scenario steps. Can we then change the Activity diagram Activities to modify the scenario steps?
Yes. You follow the same process mentioned in the above help topic Generate Scenario From Activity Diagram.
This clarifies the response given during the live session.
Generating Test Cases from Scenarios
What is the difference between internal and external Test Cases?
External Test Cases are model elements that exist in the model hierarchy as shown in the Project Browser. As 'first-class' elements, Test Cases can be placed on diagrams and have connectors to link them to other elements. They can therefore be connected, or traced, to multiple elements via Dependency connectors, for example.
Internal Test Cases exist within a model element. They define the detailed steps of a particular test (as well as relevant test metadata such as 'Status' and 'Last Run Date'). External Test Case elements can therefore contain one or more internal Test Cases.
When deciding whether to generate internal or external Test Cases from a Use Case model, determine how you want to use and access your Test Cases in the model. For the tightest traceability between a Use Case and its corresponding scenario (black-box) tests, you might choose internal Test Cases. That way, the scenario tests reside directly within the Use Case element. If you'd prefer to separate your Test and Use Case models, however, generate an External Test Case. It will still contain the appropriate set of Internal Test Cases, but you have flexibility as to where those tests reside in the model.
Each approach supported by Enterprise Architect's Structured Specification tab is illustrated below:
Why does Enterprise Architect provide Trace links to generated Test Case elements, but not to generated Activities?
The generated Activities are child elements of the Use Case element, so the trace is somewhat implicit. This is most evident when viewing the Activities in the Project Browser.
Generating Documentation from Scenarios
Can you share the report template you used for documenting structured scenarios?
The report template is included in the sample project file. You can access the template from the menu: Project | Documentation | Document Template Designer.
The template is named My Structured Scenario Template. (Use the second drop-down list at the top of the editor to select it.)
Can you explain how you created the report template?
It was created from the structured scenarios template that comes out-of-the-box with Enterprise Architect. I added a cover page and altered the way the structured scenario information is organized in the table. Some fields were excluded to make the generated report more succinct. Here are some presentations that cover template editing in more detail: