Use case modeling. Use case modeling Søren Langkilde Madsen mail: mail:

Similar documents
SE Assignment III. 1. List and explain primitive symbols used for constructing DFDs. Illustrate the use of these symbols with the help of an example.

Software Engineering Lab Manual

Properties of High Quality Software. CSE219, Computer Science III Stony Brook University

Analysis and Design with the Universal Design Pattern

Pattern for Structuring UML-Compatible Software Project Repositories

1: Introduction to Object (1)

1 Introduction. 1.1 Introduction

History of object-oriented approaches

The Web Service Sample

Darshan Institute of Engineering & Technology for Diploma Studies

Software Service Engineering

Lab Manual. Object Oriented Analysis And Design. TE(Computer) VI semester

Word for Research Writing I: Text and Structure

Course 3 7 March

Lecture Notes UML UNIT-II. Subject: OOAD Semester: 8TH Course No: CSE-802

This chapter is intended to take you through the basic steps of using the Visual Basic

As a lab attendant, you will be using isupport to put in tickets for issues that you work on. Those are going to break down to a few general types.

Applying UML to System Engineering Some Lessons Learned Murray Cantor Principal Consultant

Object-Oriented Design

1: Specifying Requirements with Use Case Diagrams

SOFTWARE DESIGN COSC 4353 / Dr. Raj Singh

Topic : Object Oriented Design Principles

Object Oriented Software Development CIS Today: Object Oriented Analysis

Computer and Programming: Lab 1

Introduction to Software Engineering: Analysis

Word for Research Writing I: Text and Structure

UML Component Diagrams A.Y 2018/2019

Review: Cohesion and Coupling, Mutable, Inheritance Screen Layouts. Object-Oriented Design CRC Cards - UML class diagrams

Introduction to Software Engineering. 5. Modeling Objects and Classes

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

Introducing the UML Eng. Mohammed T. Abo Alroos

Earthwork 3D for Dummies Doing a digitized dirt takeoff calculation the swift and easy way

Modeling Requirements

Course "Softwaretechnik" Book Chapter 2 Modeling with UML

BLUEPRINT READER 2010 INSTALLATION & USER GUIDE 09OCT09

Unified Modeling Language - UML

Requirements Modeling

UML 2.0 UML 2.0. Scott Uk-Jin Lee. Division of Computer Science, College of Computing Hanyang University ERICA Campus

UML Tutorial. Unified Modeling Language UML Tutorial

1. Write two major differences between Object-oriented programming and procedural programming?

COSC 3351 Software Design. An Introduction to UML (I)

Object-Oriented Systems Development: Using the Unified Modeling Language

VISHNU INSTITUTE OF TECHNOLOGY Vishnupur, BHIMAVARAM

Unified Modeling Language

Object-Oriented Systems Analysis and Design Using UML

Software Development. Modular Design and Algorithm Analysis

IDERA ER/Studio Software Architect Evaluation Guide. Version 16.5/2016+ Published February 2017

Oral Questions. Unit-1 Concepts. Oral Question/Assignment/Gate Question with Answer

Chapter 1: Principles of Programming and Software Engineering

OBJECT ORIENTED DESIGN with the Unified Process. Use Case Realization

LABORATORY 1 REVISION

CSC Advanced Object Oriented Programming, Spring Overview

Architecture and the UML

Testing Documentation

Design and Information Hiding

Introduction to UML What is UML? Motivations for UML Types of UML diagrams UML syntax Descriptions of the various diagram types Rational Rose (IBM.. M

Modeling Issues Modeling Enterprises. Modeling

Lecture 8: Use Case -Driven Design. Where UML fits in

Verification and Correction of UML Models

Incremental development A.Y. 2018/2019

Pattern-Oriented Development with Rational Rose

A SYSTEMATIC APPROACH FOR COMPONENT-BASED SOFTWARE DEVELOPMENT

Component Design. Systems Engineering BSc Course. Budapest University of Technology and Economics Department of Measurement and Information Systems

OBJECT ORIENTED DESIGN with the Unified Process. Use Case Realization

Introduction to IRQA 4

SOFTWARE MODELING AND DESIGN. UML, Use Cases, Patterns, and. Software Architectures. Ki Cambridge UNIVERSITY PRESS. Hassan Gomaa

University of Calgary Department of Electrical and Computer Engineering. SENG : Object Oriented Analysis and Design Behrouz Homayoun Far

Unified Modeling Language (UML)

Research Review on Basic Principles of Unified Modelling Language

A - 1. CS 494 Object-Oriented Analysis & Design. UML Class Models. Overview. Class Model Perspectives (cont d) Developing Class Models

Passport Automation System

Software Design Description Report

Importance of Rational ROSE in Software Development Process Models

Handout 4: Version Control Reference

Best Practices for Model-Based Systems Engineering

Introduction to Software Engineering. ECSE-321 Unit 9 Architectural Design Approaches

A Beginner s Guide to Successful Marketing

A Reconnaissance on Design Patterns

CSK. VDMTools. The Rose-VDM++ Link CSK

Diseño y Evaluación de Arquitecturas de Software. Architecture Based Design Method

Chapter 2 Entity-Relationship Data Modeling: Tools and Techniques. Fundamentals, Design, and Implementation, 9/e

Q &A on Entity Relationship Diagrams. What is the Point? 1 Q&A

Using Microsoft Excel

Visual Paradigm Doc. Composer Writer s Guide

Managing Change and Complexity

Chapter 5, Analysis: Object Modeling

CTC Accounts Active Directory Synchronizer User Guide

Chapter 2, Modeling with UML, Part 2

From Analysis to Design. LTOOD/OOAD Verified Software Systems

CASE TOOLS LAB VIVA QUESTION

Unified Modeling Language

Engineering Design w/embedded Systems

Software Development Methodologies

Object-Oriented Design

Software Engineering Prof.N.L.Sarda IIT Bombay. Lecture-11 Data Modelling- ER diagrams, Mapping to relational model (Part -II)

Clean & Speed Up Windows with AWO

Components Based Design and Development. Unit 3: Software Design Quick Overview

The Dynamic Model. An Introduction to UML. Enterprise Architect. by Geoffrey Sparks. All material (c) Geoffrey Sparks

CeweCetrics Start up manual

SCOS-2000 Technical Note

Transcription:

<<extends>> Use Case 3 <<communicates>> Use Case 1 <<includes>> Actor <<communicates>> Use Case 4 Use Case 2 Item: Author: Use case modeling Søren Langkilde Madsen mail: soeren.langkilde@tietoenator.com mail: slm@fagerbo.dk Date: 24/08/00 Contents 1 INTRODUCTION... 2 2 WHAT S A USE CASE MODEL... 3 2.1 WHAT'S AN ACTOR... 3 2.2 WHAT'S NOT AN ACTOR... 3 2.3 HOW TO FIND ACTORS... 3 2.4 WHAT'S A USE CASE... 3 2.5 WHAT'S NOT A USE CASE... 4 2.6 HOW TO FIND USE CASES... 4 2.7 RELATIONS BETWEEN USE CASES... 4 2.8 HOW MANY USE CASES?... 5 2.9 FURTHER READING... 5 3 FURTHER MODELING... 6 3.1 DETAILED USE CASE DESIGN... 6 3.2 DESCRIBE NORMAL AND ALTERNATIVE FLOWS... 6 3.3 FINDING DOMAIN CLASSES... 6 3.4 CATEGORIZING DOMAIN CLASSES... 6 4 COMMON FLAWS AND MISTAKES... 7 4.1 MAKING A DATAFLOW DIAGRAM... 7 4.2 MAKING FUNCTIONAL DECOMPOSITION... 7 4.3 MAKING TOO DETAILED DIAGRAMS... 8 5 APPENDIX A: ACTOR DESCRIPTION... 9 6 APPENDIX B: USE CASE DESCRIPTION... 10 7 APPENDIX C: USE CASE FLOWS... 11 Page 1 of 11

1 Introduction This is a very short description of the whats and the hows plus the what-not s and the how-not s of Use Case modeling. There are some important aspects that is not described in this little introductionary description. Abstraction level You can have models on conceptual level describing what the system can do. You can have a concrete model describing how the system is going to be build. You can have a model on implementation level describing the system in implementation diagrams and source code. The Use Case model mainly belong to the conceptual level, but can sometimes be modeled into the concrete level. This abstraction level aspect is described in this document. Traceability The Use Cases do have a direct connection/relation to the requirements on one side and to the static and dynamic part of the conceptual model on the other side. The traceability aspect with concrete descriptions of how the relations is established and maintained is not described in this document. Model organization When you have a model with more than a few Use Cases, classes, sequences a.s.o. you can organize the model into packages. The modeling aspect is not described in this document. Process Use Case modeling is a part of a software development process. How the modeling fits into the overall process is not described in this document. OK, what is described in this document then? Well the purpose of the document is to help you make as good Use Case models as possible. The descriptions should help you avoiding the most common mistakes. Description of the elements of a Use Case model, Actors and Use Cases, is found. A short description of how you model the Use Case model further is found. At last three common majorbommers are described. Page 2 of 11

2 What s a Use Case Model A Use case model is a functional description of the system you re going to build. The model elements are Actors and Use Cases. The Use Case model consists of one or more Use Case diagrams and a description for each Actor and each Use Case. These descriptions can be kept in a separate document (one for each Use Case) or as a documentation attribute in the Use Case model. See Appendix B: Use Case description page 10. Use Case description <<communicates>> Use Case 1 <<extends>> <<includes>> Use Case 3 Use Case description Actor <<communicates>> Use Case 2 Use Case 4 Use Case description Use Case description Figure 1 Use Cases and descriptions A description of what you must describe for each Use Case is found in Appendix B: Use Case description page 10. 2.1 What s an Actor An Actor is someone or something that interacts with the system (the application). An Actor can be e.g. a fieldtester or a mobile phone. 2.2 What s not an Actor An Actor is not a concrete person, e.g. John Doe. An Actor is a User type. 2.3 How to find Actors When you are looking for the Actors of the system, you can ask questions like the following: Who or what is using the system? Who or what gets support from the system? Who or what will maintain the system? Which hardware devices do the system need to handle? Questions like these will give you candidates for Actors. 2.4 What s a Use Case A Use case is a type of scenarios, a class of typical uses of the application. A Use Case is a complete functionality. An Actor initiates a Use Case. Specialized Use Cases (extends & includes) are initiated by other Use Cases. See Relations between Use Cases page 4. Page 3 of 11

2.5 What s not a Use Case Parts of functionality like e.g. Messagebox popup, initializing COM port etc. Sub-functionality is not a Use Case but part of a Use Case. 2.6 How to find Use Cases When you are looking for Use Cases you can ask questions like the following: Which functions/services (full functions) does Actors require from the system? What does the Actor need to do? Does the Actor need to read, create, destroy, modify or store some kind of information in the system? Does the Actor need to get notified when some events occur in the system? Can some Actors daily work be simplified by functionality in the system? If so what work? 2.7 Relations between Use Cases You can have plain relations between Use Cases and between Actors and Use Cases. A relation like this means one Use Case activates another. The most common of these relations is an Actor that <<communicates>> with a Use Case. <<communicates>> Actor UseCase (from FrontPage) Figure 2 communicate relation The <<communicate>> 1 stereotype indicates that the Actor communicates with the system, meaning the Actor uses some functionality described in the Use Case. <<extends>> Use Case 3 Use Case 1 <<includes>> Use Case 4 Figure 3 Extend and include specialization When you do more detailed modeling on a Use Case model you can model common parts of Use Cases into new Use Cases (specialized Use Cases). These sub-routines can be of two different types; 1 Stereotypes: In the diagrams you can mark elements as a specialized type. You mark these stereotyped elements with guillemets like: <<communicate>> Page 4 of 11

<<extends>> and <<includes>>. Observe that this relation between Use Cases is a specialization 2 (a line with a big hollow arrowhead). When you are looking for Use Cases that filter out some common functionality and when you are going to label (stereotype) the relations with either <<extend>> or <<include>> you must understand two things. First you must be able to extract the right functionality out of the original Use Cases. Second you must be able to know the difference between <<extend>> and <<include>>. A Use Case is a type (class) of scenarios. Through there is one normal flow and some abnormal (alternative) flows. If you have some part of these flows that are common for more than one Use Case, you can separate these common parts into new Use Cases that will be reused by the original Use Cases. When one Use Case reuse another Use Case it is marked with a specialization relation with the stereotype <<extend>> or <<include>>. UML < 1.3 UML 1.3 Meaning extends extend optional uses include mandatory 2.8 How many Use Cases? This is always the "1.000.000 dollar question". Many have tried to give a rule-of-thumb for how many Use Cases a good model contains. One of the better answers is that a Use Case corresponds to 6-12 man-months. The amount of Use Cases depends on the application type. If you compare two application types like an intranet application and a technical application for measuring activities inside a mobile phone (a phone-meter) you will se that the intranet applications Use Case model will contain a larger number of Use Cases than the technical phone-meter. The intranet application has many different user types (Actors) and it communicates with several other systems (Actors) like e.g. a mainframe system. There are a lot of different uses (Use Cases) of this intranet application. The technical application, the phone-meter, only has one user type, the fieldtester, and it only communicate with the phone. The fieldtester a less different uses (Use Cases) of his/hers phone-meter. If you end up with a Use Case model with way to many Use Cases you ve probably been doing functional decomposition instead of Use case modeling. See Making functional decomposition page 7. 2.9 Further reading Use Case modeling is described in the Rational Unified Process (RUP). See Core Workflows -> Analysis & Design -> Activity Overview 2 Specialization: This relation is normally used for showing inheritance. You must just accept that this relationtype is used for this extension/include relation. You can also send a mail to Ivar Jacobson and ask him about the rationale behind this choice. Page 5 of 11

3 Further modeling 3.1 Detailed Use Case design The Use Case model is primarily an analysis model. It s a structured way of describing the functionality of the system you re going to build. I certain situations it can be valuable make a detailed analysis of the Use Case model. In this detailed analysis you typically look at extension points and specializations of the Use Cases. 3.2 Describe normal and alternative flows In the model you describe each flow through the Use Case in a sequence diagram. You describe both the normal flow and the alternative (ab-normal) flows. An Actor often initiates the sequence diagrams. 3.3 Finding Domain classes Domain classes emerge during the sequence modeling. The sequence diagrams shows how classes and Actors work together. The Actors is automatically candidates for classes. 3.4 Categorizing Domain classes Entity Class Boundary Class Control Class Figure 4 Stereotypes for domain classes After having found domain classes during sequence modeling you can categorize these domain classes into three categories: Entity, Boundary and Control classes. You mark the classes with stereotypes 3. Entity class Boundary class Control class Hold information (datamodel) and associated behavior. You typically have several entity classes pr. Use Case. This class type corresponds to the Model classes in a Model-View-Controller pattern or the Abstraction (inner) class in the Presentation-Abstraction-Controller pattern. Handles communication between classes. You typically have one boundary class pr. Use Case. This class type corresponds to the View classes in a Model-View-Controller pattern or the Presentation (inner) class in the Presentation-Abstraction-Controller pattern. Controls behavior. You typically have one control class pr. Use Case. This class type corresponds to the Controller classes in a Model-View-Controller pattern or the Controller (inner) class in the Presentation-Abstraction-Controller pattern. 3 stereotypes: All model items in UML can be stereotyped. This means that you added a certain meaning to the entity. Classes can be categorized. Page 6 of 11

4 Common flaws and mistakes 4.1 Making a dataflow diagram Phone Transform Filter Transform Write Message DB In Structured Analysis 4 you did make diagrams showing how data flows through the system. The boxes are datastores, the ellipses are processes and the arrows are data flow. It is important that you do not mistakenly do this dataflow modeling when you should do Use Case modeling. In other words, a Use Case diagram do not show how data flows through the system. The Use Case model/diagram shows the functionality of the system. Logfile Figure 5 Dataflow diagram 4.2 Making functional decomposition Log Open Examine Position Close Count BM Make BM list Decorate list Figure 6 Functional decomposition In Structured Analysis you handled complexity by decomposing functions into sub-functions. This was/is done in a functional decomposition diagram. It is important that you do not mistakenly do this functional decomposition when you should do Use Case modeling. In other words, a Use Case diagram do not show a functional decomposition of the system. The Use Case model/diagram shows the functionality of the system. Back in the good old days of structured analysis it was a typical mistake to do data flow modeling when you should do functional decomposition and vice versa. 4 Structured Analysis: Popular method (the religion) for software development in the late 1970 ies and the early 1980 ies. Page 7 of 11

4.3 Making too detailed diagrams It is a very common mistake to make Use Case diagram way too detailed. There are multiple sources to this mistake. If you are doing functional decomposition and you are consequent you will end up the whole system decomposed into tiny functions. The same thing happens if you mistakenly get focused on modeling the dataflows in the system. Another source of errors is if you forget the rule that says that a Use Case must be a complete functionality. Every time you break this rule you end up with small incomplete functional pieces. A nasty biproduct of this mistake is that you get a mountain of dependencies between the Use Cases making the model almost impossible to maintain. The last source of errors is making the descriptions of the Use Cases too detailed because you describe the implementation. This means that your Use Case descriptions contains the how s and not the what s. If you find yourself writing the exact prompts, error messages, describing dialogbox layout a.s.o. Then you are on a wrong track and you must punish yourself. Page 8 of 11

5 Appendix A: Actor description The Actors is fairly easy to describe. Actors have a lot in common with classes and can sometime end up as classes in to system or as domain classes that do not go into the design model. Domain classes normally do, but not always. Name The name of the Actor. Actor type Is the Actor a user type or a device that communicates with the system. Role The role the Actor plays in the system Use Case relations Which Use Cases do the Actor have relations to. Actor relations Relations to other Actors. This can be a specialization. If you have sevaral user types, and these do have some communality, the common thing can be generalized into a super type from which the specialized Actors can inherit. Page 9 of 11

6 Appendix B: Use Case description Introduction Short introduction to the Use Case. Description Describe the normal flow through the Use Case. Pre-conditions Which conditions must be meet before the Use Case begins. Post-conditions What is guarantied after the Use Case ends. Exceptions Describe the alternative flow through the Use Case. Figure 7 Description of Use Cases Figure 7 Description of Use Cases shows a dialog from an extension to Rose. You can use this to make descriptions for each Use Case. The description are placed in the documentation attribute of the Use Case model element. An alternative is to make a document containing Use Case description. Figure 8 Documentation window in Rose Page 10 of 11

7 Appendix C: Use Case flows Use Case Scenario A Scenario B Scenario C Scenario D Figure 9 Use Case flows Figure 9 Use Case flows shows an example of a normal and some abnormal (alternative) flows through a Use case. Scenario A is the normal flow through the Use Case, everything goes normal it s a straight flow. Scenario B to D is abnormal flows. At some point (small circles) an exception occurs and some alternative route is taken. The informal diagramtype can be usefull when mapping out all the flows through a Use Case. Page 11 of 11