Sie sind auf Seite 1von 45

Analysis Modeling

Two primary methods today


Structured

Analysis Object-oriented analysis

Some important considerations


Analysis

products must be maintainable Effective partitioning is essential Graphics should be used whenever possible Distinguish between logical and implementation
August 2003 1

Structured Analysis

Elements of Analysis

Describe what customer requires Establish basis for creating software design Define requirements that can be validated

August 2003 2

Graphical View of Model

Entity Relationship Diagram ( ERD) Data

Data Flow Diagram (DFD)

Dictionary State Transition Diagram (STD)

August 2003 3

Data Modeling

The model consists of


Data object [types] Attributes Relationships A representation of almost any composite information that must be understood by software.
4

Data objects

August 2003

Data Modeling

Attributes

Attributes define the properties of a data object and take on one of three different characteristics:

Name an instance of the data object Describe the instance Make reference to another instance Referential Descriptive attributes Naming attributes attributes Identifier

Make

Model

ID#
Q12A45.. AB123...

Body type Color Owner


Sedan Sports Blue White ABC XYZ
5

Ford Taurus August Lexus 2003 LS400

Data Modeling

Relationships

Defined pairwise -- many varieties orders displays

Book

sells returns

Bookstore

August 2003 6

Cardinality and Modality

Cardinality

How many occurrences of object X are related to how many occurrences of object Y

One-to-one (1:1) One-to-many (1:N) Many-to-many (M:N)

Modality

=0 => optional relationship =1 => relationship must appear


7

August 2003

Example

Customer

is provided with

Repair action

Mandatory: in order to have a repair action, we must have a customer

Optional: there may be a situation in which a repair action is not necessary

August 2003 8

Entity Relation Diagrams (ERD)

Cornerstone of the data model -- includes


data objects, attributes, relationships, and various type indicators


builds

manufacturer

car

Data Object Table


ID# model
August 2003 9

body type

engine

transmission

...

Example

August 2003 10

Data Object Hierarchies

August 2003 11

Associating Data Objects

August 2003 12

Functional Modeling

Entity Relationship Diagram

Data Flow Diagram


Data Dictionary State Transition Diagram ( DFD )

August 2003 13

Data Flow Diagrams (DFD)

A graphical technique that depicts information flow and the transforms applied as data move from input to output Not the same as flow charts. Does not show the logic of the transformations Can be used at any level of abstraction

August 2003 14

General Information Flow Model

August 2003 15

Basic Notation

August 2003 16

Information Flow Refinement


A F B

V f1 W f3

f2

X f4 Y Z f5 z1 z3

f6

z2
f7

f41 f42

x1
y1

f43 f44

x2 y2

f45

Z
17

Y
August 2003

Real Time Extensions

Fundamental issue - The time at which results are produced is a part of the correctness of the computation. Hatley/Pirbhai notation

August 2003 18

Ward/Mellor Notation

August 2003 19

Example

August 2003 20

Example

August 2003 21

Hatley and Pirbhai Extensions


Use separate data flow diagram (DFD) and control flow diagram (CFD) Data flow diagrams

Used to represent data and the processes that manipulate it Show how events flow among processes and show those external events that cause various processes to be activated
22

Control flow diagrams

August 2003

Relationship Between Models

August 2003 23

Example

August 2003 24

CFD for Photocopier


paper feed status (jammed, empty) start/stop alarm

Copy
read operator Info input

manage copying

status

produce user displays Problem type

Reload status perform reload paper full


August 2003

problem diagnosis

repro fault

25

Behavioral Modeling

Entity Relationship Diagram

Data Flow Diagram Data Dictionary

State Transition Diagram


August 2003 26

( STD )

State Transition Diagrams

A State is any observable mode of behavior

e.g., reading commands, computing control, waiting for next time event

States represented as rectangles Arrows represent transitions Value above arrow identifies event causing transition Value below arrow indicates ensuring action
27

August 2003

State Transition Diagram


full and start invoke manage-coping idle invoke read-op-input reading commands full invoke read-op-input reloading paper

copies done invoke read-op-input making copies

empty invoke reload paper

jammed
invoke perform problem-diagnosis
August 2003

diagnosing problem

not jammed invoke read-op-input


28

Creating an ERD

List entities that customer addresses For each, determine the connections For each connection, create one or more object-relationship pairs For each relationship, determine cardinality and modality Define the attributes of each entity Formalize and review ERD Iterate
29

August 2003

Home Security System Example

Initial entities

Homeowner, control panel, sensors, security system and monitoring service

August 2003 30

Home Security System Example

Relationships between sensor and security sys.


Security system monitors sensor Security system enables/disables sensor Security system tests sensor Security system programs sensor

August 2003 31

Creating a Data Flow Model

First create level 0 diagram


Depict software system as single bubble Show primary inputs and outputs

Identify processes, data objects, and data stores to be expanded at next level Label all arrows with meaningful names Information flow continuity must be maintained Refine only one bubble at a time
August 2003 32

Home Security System Example

August 2003 33

Refinement

Analyze textual description of bubble

verbs are often processes nouns are often external entities, data or control objects or data stores

Examples

Control panel is used to program and configure the system Upon a sensor event, the software invokes an alarm
34

August 2003

Home Security System Example

August 2003 35

Home Security System Example

August 2003 36

Creating Control Flow Models


Strip arrows from DFD Add event and control items. E.g., try

List all sensors read by the software List all interrupt conditions List all operator actuated switches List all data conditions Check noun-verb parse for possible CSPEC I/O Identify states, how each is reached and transitions Focus on possible omissions
37

August 2003

Level 1 CFD for Safe-Home

August 2003 38

Control Specification

August 2003 39

Process Specifications

Describes all flow model processes at final level of refinement


Narrative text, Program design language description Mathematical equations Tables Diagrams Charts
41

August 2003

Data Dictionary

Entity Relationship Diagram

Data Flow Diagram Data Dictionary

State Transition Diagram


August 2003 42

Data Dictionary

Why a data dictionary? Need an organized way to represent data & control characteristics Usual contents

Name Alias Where and how used Content description (of composite items) Supplementary information, e.g., restrictions, limitations, preset values
43

August 2003

Example

Name: Shuttle position Aliases: Position-orientation vector Where used: Display of Shuttle on map Content: x, y, z position wrt to Earths Center, roll, pitch, yaw Supplementary Info: Elevation must be above 140 nautical miles
44

August 2003

Data Dictionary

Common tools supporting DD


Preventing creation of duplicate names Enforce naming conventions Printing dictionary Determine the range of impact of changes, i.e., which processes are affected Assist configuration management

August 2003 45

Summary

Key elements

Data modeling

Data objects, attributes and relationships Cardinality and modality Entity-relationship diagrams Data and control flow diagrams

Functional modeling

Behavioral modeling

State transition diagrams

Data Dictionary
46

August 2003

Das könnte Ihnen auch gefallen