1 Analysis Extracting from Use Cases to Create Diagrams.

Slides:



Advertisements
Similar presentations
Slide 12.1 © The McGraw-Hill Companies, 2002 Object-Oriented and Classical Software Engineering Fifth Edition, WCB/McGraw-Hill, 2002 Stephen R. Schach.
Advertisements

Ch 12: Object-Oriented Analysis
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
Slide 6C.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
Slide 6B.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
Irwin/McGraw-Hill Copyright © 2004 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS6th Edition.
Slide 8B.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
Lecture 4 Class Responsibility Collaboration Cards
Slide 7B.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
Chapter 21 Object-Oriented Analysis
Slide 7A.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
Slide 6A.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
1 CS1001 Lecture Overview Object Oriented Design Object Oriented Design.
Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,
Slide 12C.50 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering Sixth Edition, WCB/McGraw-Hill, 2005.
Case Study: Class Extraction.
Slide 10C.52 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering Sixth Edition, WCB/McGraw-Hill, 2005 Stephen R. Schach.
Domain Modeling (with Objects). Motivation Programming classes teach – What an object is – How to create objects What is missing – Finding/determining.
The chapter will address the following questions:
Chapter 7: The Object-Oriented Approach to Requirements
*Object-Oriented Design (Schach Chap 14)
Objects What are Objects Observations
Slide 11.1 Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Object-Oriented Software Engineering WCB/McGraw-Hill, 2008 Stephen.
OBJECT-ORIENTED ANALYSIS PHASE
Slide 12.1 © The McGraw-Hill Companies, CS 4310: Software Engineering Lecture 7 Systems Analysis Object-Oriented Design.
Object Oriented Analysis By: Don Villanueva CS 524 Software Engineering I Fall I 2007 – Sheldon X. Liang, Ph. D.
CSC 213 – Large Scale Programming Lecture 2: Object-Oriented Analysis & Object-Oriented Design.
Slide 16B.51 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 21. Review ANALYSIS PHASE (OBJECT ORIENTED DESIGN) Functional Modeling – Use case Diagram Description.
CSC 213 – Large Scale Programming Lecture 3: Object-Oriented Analysis.
Unified Modeling Language, Version 2.0
Requirement Engineering. Review of Last Lecture Problems with requirement Requirement Engineering –Inception (Set of Questions) –Elicitation (Collaborative.
Slide 10A.1 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering Sixth Edition, WCB/McGraw-Hill, 2005.
CS3320::CH111 OBJECT-ORIENTED ANALYSIS Chapter 11.
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
CSC 395 – Software Engineering Lecture 13: Object-Oriented Analysis –or– Let the Pain Begin (At Least I’m Honest!)
Lecture 14 & 15: Object- Oriented Analysis Anita S. Malik Adapted from Schach (2004) Chapter 12.
CSC 213 – Large Scale Programming. Today’s Goal  Improve design skills to make usable designs  Noun extraction & UML class diagram reviewed  Connections.
Systems Analysis and Design in a Changing World, 3rd Edition
Requirements as Usecases Capturing the REQUIREMENT ANALYSIS DESIGN IMPLEMENTATION TEST.
Chapter 12: Design Phase n 12.1 Design and Abstraction n 12.2 Action-Oriented Design n 12.3 Data Flow Analysis n Data Flow Analysis Example n
Slide 12A.1 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering Sixth Edition, WCB/McGraw-Hill, 2005 Stephen R. Schach.
Slide 12.1 Object-Oriented and Classical Software Engineering Chapter 12 Object Oriented Analysis.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
1 Modeling System Requirements with Use Cases. 2 Why Do We Need Use Cases? Primary challenge in a system design process –ability to elicit correct and.
Slide 11.1 Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. CHAPTER 11 THE ANALYSIS WORKFLOW (Derived from Stephen R. Schach’s.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Petri Nets Invented by Carl Adam Petri in 1962 Concurrent systems with timing problems  Synchronization, race problem, deadlock A petri net consists of.
Slide 13.1 © The McGraw-Hill Companies, 2002 Object-Oriented and Classical Software Engineering Fifth Edition, WCB/McGraw-Hill, 2002 Stephen R. Schach.
THE ANALYSIS WORKFLOW  The specification document  Informal specifications  The analysis workflow  Extracting the entity classes  Functional modeling:
Slide 12.1 © The McGraw-Hill Companies, 2007 Object-Oriented and Classical Software Engineering Seventh Edition, WCB/McGraw-Hill, 2007 Stephen R. Schach.
CHAPTER 13 OBJECT-ORIENTED ANALYSIS. Overview l The analysis workflow l Extracting the entity classes l The elevator problem case study l The test workflow:
Software Engineering Zhang Shuang
Lecture 9-1 : Intro. to UML (Unified Modeling Language)
Slide 12D.88 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering Sixth Edition, WCB/McGraw-Hill, 2005 Stephen R. Schach.
1 Unified Modeling Language, Version 2.0 Chapter 2.
Unit-3 Identifying use cases Object Analysis Classification
Slide 12F.135 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering Sixth Edition, WCB/McGraw-Hill, 2005 Stephen R. Schach.
CHAPTER 12 OBJECT-ORIENTED ANALYSIS. Overview Extracting the entity classes Object-oriented analysis: The elevator problem case study Functional modeling.
Engineering Quality Software Week02 J.N.Kotuba1 SYST Engineering Quality Software.
Slide 11.1 Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Object-Oriented Software Engineering WCB/McGraw-Hill, 2008 Stephen.
Object-Oriented Software Engineering WCB/McGraw-Hill, 2008 Stephen R
Cmpe 589 Spring 2006.
Object-Oriented Analysis (OOA)
Unified Modeling Language
Object-Oriented Analysis
University of Houston-Clear Lake
Copyright 2007 Oxford Consulting, Ltd
Object-Oriented and Classical Software Engineering Sixth Edition, WCB/McGraw-Hill, 2005 Stephen R. Schach
Engineering Quality Software
Presentation transcript:

1 Analysis Extracting from Use Cases to Create Diagrams

2 Overview The analysis workflow Extracting the entity classes Object-oriented analysis: The elevator problem case study Functional modeling: The elevator problem case study Entity class modeling: The elevator problem case study Dynamic modeling: The elevator problem case study The test workflow: Object-oriented analysis

3 Overview (contd) Extracting the boundary and control classes Osbert Oglesby Case Study Initial functional model Initial class diagram Initial dynamic model Extracting the boundary classes

4 Overview (contd) The Osbert Oglesby case study Refining the use cases: Use-case realization Incrementing the class diagram The specification document in the Unified Process More on actors and use cases Challenges of the object-oriented analysis workflow

5 Object-Oriented Analysis OOA is a semi-formal analysis technique for object-oriented paradigm There are over 60 equivalent techniques Today, Unified Process is most viable During this workflow The entity, boundary, and control classes are extracted

6 The Analysis Workflow The analysis workflow has two aims: Obtain a deeper understanding of the requirements Describe them in a way that will result in a maintainable design and implementation

7 Analysis Workflow There are three types of classes: Entity classes Boundary classes Control classes

8 The Analysis Workflow : Entity Class : Entity class Models long-lived information Examples: Account Class Painting Class

9 The Analysis Workflow : Boundary Class Boundary class Models the interaction between the product and the environment A boundary class is generally associated with input or output Examples: Purchases Report Class Sales Report Class Account Holder Data Gathering

10 The Analysis Workflow: Control Class Control class Models complex computations and algorithms Examples: Compute Masterpiece Price Class Compute player’s net worth Place image onto web page Store employee data

11 Object-Oriented Analysis: The Elevator Problem Case Study A product is to be installed to control n elevators in a building with m floors. logic is required to move elevators between floors according : 1.Each elevator has a set of m buttons, one for each floor. These illuminate when pressed and cause the elevator to visit the corresponding floor. The illumination is canceled when the corresponding floor is visited by the elevator 2.Each floor, except the first and the top floor, has two buttons, one to request an up-elevator, one to request a down-elevator. These buttons illuminate when pressed. The illumination is canceled when an elevator visits the floor, then moves in the desired direction 3.If an elevator has no requests, it remains at its current floor with its doors closed

12 Functional Modeling: The Elevator Problem Case Study A use case describes the interaction between The product, and The actors (external users)

13 Use Cases For the elevator problem, there are only two possible use cases Press an Elevator Button, and Press a Floor Button

14 Scenarios A use case provides a generic description of the overall functionality A scenario is an instance of a use case Sufficient scenarios need to be studied to get a comprehensive insight into the target product being modeled

15 Normal Scenario: Elevator Problem

16 Exception Scenario: Elevator Problem

17 Entity Class Modeling : The Elevator Problem Case Study Extract classes and their attributes Represent them using a UML diagram One alternative: Deduce the classes from use cases and their scenarios Possible danger: Often there are many scenarios, and hence too many candidate classes Other alternatives: CRC cards (if you have domain knowledge) Noun extraction

18 Noun Extraction A two-stage process: Problem definition Extract nouns Stage 1. Concise problem definition Describe the software product in single paragraph Buttons in elevators and on the floors control the movement of n elevators in a building with m floors. Buttons illuminate when pressed to request the elevator to stop at a specific floor; the illumination is canceled when the request has been satisfied. When an elevator has no requests, it remains at its current floor with its doors closed

19 Noun Extraction Stage 2. Identify the nouns Identify the nouns in the informal strategy Buttons in elevators and on the floors control the movement of n elevators in a building with m floors. Buttons illuminate when pressed to request the elevator to stop at a specific floor; the illumination is canceled when the request has been satisfied. When an elevator has no requests, it remains at its current floor with its doors closed Use the nouns as candidate classes

20 Noun Extraction (contd) Nouns button, elevator, floor, movement, building, illumination, request, door

21 Noun Extraction (contd) Nouns button, elevator, floor, movement, building, illumination, request, door are all nouns floor, building, door are outside the problem boundary — exclude movement, illumination, request are abstract nouns — exclude (they may become attributes) Candidate classes: Elevator and Button Subclasses: Elevator Button and Floor Button

22 First Iteration of Class Diagram

23 First Iteration of Class Diagram Problem Buttons do not communicate directly with elevators

24 First Iteration of Class Diagram Problem Buttons do not communicate directly with elevators We need an additional class: Elevator Controller

25 Second Iteration of Class Diagram All relationships are now 1-to-n This makes design and implementation easier

26 CRC Cards Used since 1989 for OOA For each class, fill in a card showing Name of Class Functionality (Responsibility) List of classes it invokes (Collaboration) Now CRC cards are sometimes automated

27 CRC Cards (contd) Strength When acted out by team members, CRC cards are a powerful tool for highlighting missing or incorrect items Weakness If CRC cards are used to identify entity classes, domain expertise is needed

28 Dynamic Modeling: The Elevator Problem Case Study Produce a UML statechart This UML statechart is equivalent to the state transition diagram State, event, and predicates are distributed over the statechart

29 Dynamic Modeling: Elevator Problem (contd) UML statechart constructed by considering specific scenarios In fact, a statechart is constructed by modeling the events of the scenarios

30 Dynamic Modeling: The Elevator Problem Case Study UML statechart

31 The Test Workflow: Object- Oriented Analysis CRC cards are an excellent testing technique

32 CRC Cards Consider responsibility 1.Turn on elevator button This is totally inappropriate for the object-oriented paradigm Responsibility-driven design has been ignored Information hiding has been ignored Responsibility 1.Turn on elevator button should be 1.Send message to Elevator Button to turn itself on

33 CRC Cards (contd) Also, a class has been overlooked The elevator doors have a state that changes during execution (class characteristic) Add class Elevator Doors Safety considerations Modify the CRC card

34 Second Iteration of the CRC Card

35 CRC Cards (contd) Having modified the class diagram, reconsider the Use-case diagram (no change) Class diagram (see the next slide) Statecharts Scenarios (see the slide after the next slide)

36 Third Iteration of Class Diagram

37 Second Iteration of the Normal Scenario:

38 OOA: Elevator Problem The object-oriented analysis is now fine We should rather say: The object-oriented analysis is fine for now We may need to return to the object-oriented analysis workflow during the object-oriented design workflow

39 Extracting Boundary and Control Classes Each Input screen, Output screen, and Report is modeled by its own boundary class Each nontrivial computation is modeled by a control class (unless embedded within an entity class? )

40 The Initial Functional Model: Osbert Oglesby Case Study Recall the Osbert Oglesby use-case diagram:

41 First Scenario of Use Case Buy a Masterpiece Normal scenario

42 First Scenario of Use Case Buy a Masterpiece (contd) Only four of the six paragraphs in the scenario are numbered The two unnumbered sentences “Osbert wishes to buy a masterpiece” and “Osbert makes an offer below the maximum purchase price — the offer is accepted by the seller” have nothing to do with the interaction between Osbert and the software product These unnumbered paragraphs are essentially comments

43 Second Scenario of Use Case Buy a Masterpiece Exception scenario

44 Third Scenario of Use Case Buy a Masterpiece This is another exception scenario

45 Extended Scenario of Use Case Buy a Masterpiece Normal and exception scenarios can be combined into an extended scenario

46 Analysis Steps Perform three steps incrementally and iteratively: Functional modeling Present scenarios of all the use cases (a scenario is an instance of a use case) Class modeling Determine the entity (and other) classes and their attributes Determine the interrelationships and interactions between the entity classes Present this information in the form of a class diagram Dynamic modeling Determine the operations performed by or to each entity class Present this information in the form of a statechart