You are on page 1of 47

ANALYSIS MODELING

The written word is a wonderful vehicle for communication. But it is not a best way to represent the requirements for computer S/W. Analysis modeling uses a combination of text and diagrammatic forms to depict the requirements for data, function and behavior in a way that it can be easily Understood, and straight forward way to review for correctness, completeness, and consistency. A BRIEF HISTORY Researchers need a graphical notation for representing data and process that transform it.

so, The term STRUCTURED ANALYSIS , originally coined by Douglas Ross, was Popularized by Demacro.
Demacro introduced the key graphical symbols and models.

Various structured analysis approach were suggested by page-Jones, Gane and Sarson. By the mid-1980s real-time extensions were introduced by Ward and Mellor.

These extensions resulted in a more robust analysis method for engineering problems.

The Elements of Analysis Model The Analysis Model must achieve three primary objectives. i) to describe what customer requires ii) to establish a basis for creation of the S/W design. iii) to define a set of requirements for the S/W is to be build. The structure of the analysis model is shown below. The Core of this model is Data Dictionary- a Repository that contains Descriptions of all data objects consumed or produced by the S/W. The Entity Relationship Diagram (ERD)- depicts relationship between data objects .

The Data Flow Diagram (DFD) serves two purposes. i) To provide an indication of how data are transformed as they move through the system. ii) To depict the functions that transform the data flow. A Description of each function presented in the DFD is contained in a process specification.

Entity relationship diagram Data dictionary

Data flow diagram

State-transition diagram

Figure : The Structure of analysis model

The State transition Diagram (STD) - indicates how the system behaves as a consequence of external events. The information about the control aspects of the S/W is contained in the Control Specification (CSPEC). DATA MODELING : Data modeling methods make use of ERD. ERD is useful for applications in which data and the relationships that govern data are complex. i) Data objects, Attributes, and Relationships: The Data model consists of three interrelated information. i) Data Object ii) Attributes that describe the data object. iii) Relations that connect data objects.

Data Objects :

A data object is a representation of any composite information that must be understood by the S/W. Composite Information means something that has a number of different properties and attributes.

A data object can be an external entity, a thing, an occurrence, or event, a role , an organizational Unit, a place, or a structure.
For ex: a person or a car is viewed as a data object means either can be defined in terms of a set of attributes. Which is illustrated below

Objects:

Attributes:

Relationship:

Name

Address
Age Drivers License Number

Owns Model

ID number
Body type Color

Data objects are related to one another. For ex: Person can own Car

Data objects encapsulates data only- there is no reference within in data objects. That is a car is defined in terms of model, ID number, body type, Color and owner.
Attributes: Attributes define the properties of a data object and take one of the three different characteristics. i) name an instance of an data object ii) Describe the instance iii) make the reference to another instance in another table. In addition one or more attributes must be defined as an identifier- the identifier Attribute becomes a key when we want to find an instance of the data object

For ex: Referring to the data object car, a reasonable identifier might be the ID number.

Relationships : Data objects are connected to one another in different ways. Consider two objects, book and bookstore. These objects can be represented using the simple notation as shown below.

Book

Bookstore

(a) A basic connection between objects


Orders

Book

Displays Stocks Sells Returns

Bookstore

(b) Relationships between objects

A Connection is established between book and book store because two objects are related.

A set of relevant relationship that defines the data objects are i) A bookstore orders books. ii) A bookstore displays books iii) A bookstore stocks books iv) A bookstore sells books v) A bookstore returns books
The relationship orders, displays, stocks, sells and returns define the relevant relationship between Book and Bookstore.

It is important to note that the object relationships are bi-directional. that is A bookstore orders books or books are ordered by a bookstore.

Cardinality and Modality The data model must be capable of representing the number of occurrences objects in a given relationship. Tillmann defines the cardinality of an object / relationship pair in the following manner Cardinality is the specification of the number of the occurrences of one object That can related to number of occurrences of another object. Cardinality is usually expressed as simply one or many For ex: A Husband can have only one wife. A Parent can have many children. Taking all combination of one and many can be related as

i) One-to-One (1:1) : An occurrence of object A can relate to one


and only occurrence of object B, and an occurrence of B can relate to only one occurrence of A.

ii One-to-Many (1:N) : one occurrence of object A can relate to one or manyOccurrence of object B , but an occurrence of object B can relate to only one occurrence of A. III) Many-to-Many (M:N) : An occurrence of object A can relate to one or more Occurrence of B, while an occurrence B can relate to one or more occurrence of A.

Cardinality defines The maximum number of objects that can participate in a Relationship. Modality : The Modality of a relationship is 0 if there is no explicit need for the Relationship to occur or the relationship is optional.
The Modality is 1 if an occurrence is relationship is mandatory

For ex; Consider the S/W that is used by a local telephone company to process request for field service.

A customer indicates that there is a problem. If a problem is diagnosed as relatively simple, a single repair action occurs. If the problem is complex , multiple repair action may be required. This illustrated below.
Referring to the figure one to many cardinality relationship occur.ie, A single Customer Can be provided with zero or many repair actions. The Vertical bar indicates ONE. The thee-pronged fork indicates MANY The second vertical Bar on the left indicates that there must be a customer for repair Action. The circle on the right indicates that there are may be no repair action required for the type of the problem reported by the customer

Cardinality: Implies that a single Customer awaits repair action(s)

Cardinality: Implies that there may be many repair action(s)

Customer

is provided with

Repair action

Modality: Mandatory Implies that in order to have a repair action(s), we must have a customer

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

Figure : Cardinality and modality

Entity/ Relationship Diagrams The object / Relationship pair can be represented graphically using the entity / Relationship diagram. ERD was proposed by Peter Chen. A set of primary components of ERD are Data objects Attributes Relationships and Various type indicators. In ERD Data objects are represented by a labeled Rectangle. Relationships are indicated with a labeled line connecting objects. The relationship between the data objects car and manufacturer is illustrated below. One manufacturer builds one or many cars.

manufacture

builds

car

Data object table


ID # Model Body type Engine Transmission

***

Figure : A simple ERD and data object table ( Note : In this ERD the relationship builds is indicated by a diamond )

Expanding the model, we can get the following ERD .

Licenses

Dealership

Stocks

manufacture

builds

car

contracts

Transport

Shipper
Figure : An expanded ERD

In the above diagram new data objects, Shipper and dealership are introduced.

In addition , new relationships- transports, contracts, licenses ,


and Stocks indicates how the data object associate with one another. Tables for each data object contained in ERD have to be developed. In addition with the basic ERD the analyst can represent data object type hierarchies. In many instances the , a data object actually represent a class or category of information. For ex: The data object Car can be categorized as Domestic, European, orAsian. The following figure gives this hierarchy of information.

car

European

Domestic

Asian

Swedish

German

French / English

Italian

Japanese

Korean

Figure : Data object-type hierarchies

ERD notation also provides a mechanism that represents the associatively between objects. An associative data object is represented below.

Electronics Engine Chassis Interior Drive train

Car
Figure : Associative data object In this figure each of the data objects that model the individual subsystems is associated with the data object Car.

FUNCTIONAL MODELING AND INFORMATION FLOW

Information is transformed as it flows through a computer based system.


The system accepts the I/P in a variety of forms. Applies H/W , S/W, and human elements to transform it. then it produces the O/P in variety of forms. We can create a flow model for any computer based system, regardless of size and complexity. Structured analysis is an information flow modeling technique. A computer based system is represented as an information transform as shown in the following figure.

Information Flow Model

External entity

Input data

External entity

Transform Intermediate #1 data

Output data

Transform Intermediate data #3


Intermediate data

Transform #4
Data store output Output data

Transform Data store input #2

External entity

Input data

Data store

External entity

In the above figure A Rectangle is used to represent an external entity. that is a system element ( e.g. : H/W, a person, another program) or Another system that produces information for transformation. A Circle (Some times called a Bubble) represents a Process or transform that Is applied to data and changes it in some way.

An Arrow represents one or more data items ( data objects). All arrow on a Data flow diagram should be labeled.
The Double line represents a Data Store Stored information that is used by the S/W. DATA FLOW DIAGRAMS As information moves through the S/W, it is modified by a series of transformations.

A Data Flow Diagram is a graphical representation that depicts the information flow and transforms that are applied as data move from I/P to O/P. The basic form of Data flow diagram , also known as a data flow graph or a Bubble chart is illustrated in the following figure.

Information Flow Model

External entity

Input data

External entity

Transform Intermediate #1 data Transform #3


Intermediate data Intermediate data

Output data

Transform #4
Data store output

Transform #2

Data store input

Output data

External entity

Input data

Data store

External entity

The DFD may be used to represent a system or S/W at any level of abstraction. DFD provides a mechanism for functional modeling as well as information flow modeling . A Level 0 DFD also called a Fundamental system or a context model, represents the Entire S/W element as a single bubble with I/P and O/P indicated by incoming and outgoing arrows. Level 0 DFD is partitioned to reveal more detail. For ex : A Level 1 DFD might contain five or six bubbles with interconnecting arrows. Each of the process represented at level 1 is a sub function of the overall system depicted in the context model. Each bubble in level 1 may be refined or layered to depict more The following figure illustrate this concept.

detail.

B A

f2
V A

Z1

f6
Z2

f1
W

f4 f3
Y

f5
Z3

f7

X Y

f41 f42

X1

f43 f44

X2

f45
y1 y2

Figure: Information flow refinement

In the above figure

A Fundamental model for system F indicates The primary I/P is A and ultimate O/p is B But we refine the F model into transforms f1 to f7. The information flow continuity must be maintained. That is the I/P and O/p remain the same. This concept is sometimes called Balancing . Further refinement of f4 depicts detail in the form of transformations f41 to f45. Again the I/P ( X,Y) and O/P (Z) remain unchanged. DFD graphical notation must be augmented with descriptive text. The Process specification describes The Input to a function The algorithm that is applied to transform the I/p. The output that is produced.

Extensions For Real Time systems A Real-time system must interact with the real world in a time frame dictated by the real world. To accommodate the analysis for real-time Software a number of extensions to the basic notation for structured analysis have been defined. These extensions developed by Ward and Mellor and Hatley and Pirbhai Ward and Mellor Extensions Ward and Mellor extend basic structured analysis notation to accommodate following demands imposed by a real time system. I)Information flow is gathered or produced on a time continuous basis.

1)

ii)Control information is passed throughout the system and associated control processing. iii) Multiple instances of the same transformations are sometimes encountered. iv) systems have states and a mechanism causes transition between the states. A Real-time test monitoring system for gas turbine engines might require to monitor Turbine speed Temperature

A variety of pressure probes on a continuous


basis. One extension for basic structured analysis notation shown in the following figure.

Monitored temperature

Input continuous
Output continuous

Monitor and adjust temperature level

Corrected value

Temperature set point


Figure: Time continuous data flow

In the above figure The double Headed arrow is used to represent time-Continuous flow .

A single headed arrow indicates discrete data flow.


In the above figure Monitored temperature is measured continuously The Corrected value is time-continuous output. In conventional DFDs Control or event flow are not represented explicitly.So, a specialized notation for control or event flows has been developed. In conventional DFD, data flow is represented in a solid arrow.

but Control flow is represented using a dashed or shaded arrow.


A process that handles only control flows, called control process is similarly represented using a dashed bubble.

Control flow can be I/P directly to the conventional process or a control process.This is illustrated in the following figure.

Status of each fixture


Parts status buffer Bit string Start / stop flag Monitor fixture & Operator interface Operator commands Robot initiation control

Movement alarm

Process activate Process robot commands Position commands

Operator settings

Robot movement record Robot command file

Figure: Data and control flows using Ward and Mellor notation [WAR85]

The figure illustrates the top-level view of a data and control for a manufacturing cell. As components are assembled by a robot are placed on fixture, a status bit is set within parts status buffer ( a Control store) indicates the presence and absence of each components. The parts status buffer is then passed in to monitor fixture and operator interface. This process will read the operator commands only when the control information , bit string, indicates that all fixtures contain components. An event flag, start/stop flag is sent to robot initiation control, a control process that enables further command processing. Other data flows occurs as a consequences of the Process active event that is to sent to process robot commands

HATLEY AND PIRBHAI EXTENSIONS

The Hatley and pirbhai extensions to basic structured analysis notation Focuses on the representation and specification of control-oriented aspects of the S/W. The Dashed arrow is once again used to represent control or event flow.
Hatley and pirbhai suggest that dashed and solid notation be represented separately. A Control flow diagram ( CFD) contains the same processes as DFD, but shows control flow , rather than data flow. Instead of representing control processes directly within the flow model , a notation reference ( a Solid Bar ) to control specification (CSPEC) is used.

The solid Bar can be viewed as a Window that controls the processes represented in DFD. The CSPEC is used to indicate 1) How the S/W Behaves when an event or control signal is sensed. 2) Which processes are invoked as a consequence of the occurrence of the event. In Hately and pirbhai representation Data flow diagrams are used to represent data and the processes that manipulate it. Control Flow Diagrams are used to show how events flow among Processes and illustrate those external events that cause various processes to be activated. The Relation ship between the process and control models is shown below.

data input

Process Model DFDs

data output

process activators

PSPECs

Control Model CFDs

data conditions

control output

CSPECs control input

Fig : The relationship between data and control models

In the above figure

The process model model is connected to the control model through data conditions.
The control model is connected to the process model through process activation information contained in the CSPEC.

A Data Condition occurs whenever data input to a process result in control Output.this situation is illustrated below.

Data flow diagram


Absolute tank pressure Converted pressure

Control flow diagram


Check & convert pressure

Above pressure

Check & convert pressure


Max pressure

PSPEC
If absolute tank pressure > max pressure then set above pressure to true; else set above pressure to false; begin conversion algorithm x-O1a; compute converted pressure; end endif

The above figure is a flow model for an automated monitoring and Control system for pressure vessels in an oil refinery. The Process check and covert pressure implements the algorithm describedin the PSPEC. When the Absolute tank pressure is greater than the allowable maximum, an above pressure event is generated. In Hatley and Pirbhai notation, the data flow is shown as the part of the DFD,While control is noted separately as part of control flow diagram.

The Vertical solid bar is an indication of above pressure event and it is a pointer To the CSPEC. So to determine what happens when this event occurs, we must check the CSPEC.

The CSPEC contains a number of important modeling tools. A Process activation table ( PAT) is used to indicate which processes are activated by a given event. BEHAVIORAL MODELING The State Transition Diagram (STD) represents the behavior of the system by depicting its states and the events that cause the system to change state. In addition, STD indicates What actions are taken as a consequence of a particular event. A State is any observable mode of behavior. For ex: States for a monitoring and Control system for pressure vessels Might be Monitoring state Alarm state Pressure release state and so on. Each of these state represents a mode of behavior of the system.

A STD indicates how the system moves form state to state. The following figure indicates the representation of the control flow for the photocopier S/W

Paper feed status (jammed, empty)

Alarm

Start/stop

Manage copying

Produce user displays

Read operator input Perform problem diagnosis Reload paper


Full Repro fault

Fig: Level 1 CFD for photocopier software

Control flows are shown entering and exiting individual processes and vertical bar Represents the CSPEC . A simplified STD for the photocopier S/W is shown below. The Rectangles represents the system state. The arrows represents the transition between the states. Each arrow is labeled with ruled expression. The top value indicates the event(s) that cause the transition to occur. The bottom value indicates the the action that occurs as a consequence of the event.

Therefore, when the paper tray is full and the start button is pressed , the system moves from the reading commands sate to the making copies state. States do not correspond to processes on a one to one basis. For ex: The state making copies would encompasses both the managing Coping and produce user displays.

Full and start Invoke manage-copying

Reading commands

Idle Invoke read-op-input

Copies done Invoke read-op-input

Full Invoke read-op-input

Making copies

Empty Invoke reload paper

Reloading paper

Diagnosing problem

Not jammed Invoke read-op-input

Fig: State transition diagram for photocopier software

You might also like