cs451 introduction to software engineering n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
CS451 Introduction to Software Engineering PowerPoint Presentation
Download Presentation
CS451 Introduction to Software Engineering

Loading in 2 Seconds...

play fullscreen
1 / 21

CS451 Introduction to Software Engineering - PowerPoint PPT Presentation


  • 89 Views
  • Uploaded on

CS451 Introduction to Software Engineering. Behavioral Modeling. Behavioral Modeling. events. behavior. Outside world. Application. Behavioral Modeling. M ake a list of the different states of a system (How does the system behave?)

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'CS451 Introduction to Software Engineering' - lixue


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
slide2

Behavioral Modeling

events

behavior

Outside

world

Application

behavioral modeling
Behavioral Modeling
  • Make a list of the different states of a system (How does the system behave?)
  • Indicate how the system makes a transition from one state to another (How does the system change state?)
    • indicate event
    • indicate action
  • Draw a state transition diagram
the states of a system
The States of a System
  • state—a set of observable circumstances that characterizes the behavior of a system at a given time
  • state transition—the movement from one state to another
  • event—an occurrence that causes the system to exhibit some predictable form of behavior
  • action—process that occurs as a consequence of making a transition
slide5

State Transition Diagram Notation

state

event causing transition

action that occurs

new state

slide6

State Transition Diagram

full and start

reading

invoke manage-copying

operator

commands

full

invoke read-op-input

copies done

invoke read-op-input

making copies

reloading paper

empty

invoke reload paper

jammed

invoke problem-diagnosis

not jammed

invoke read-op-input

problem state

control model
Control Model
  • The control flow diagram is "superimposed" on the DFD and shows events that control the processes noted in the DFD
  • Control flows
    • Events and control items—by dashed arrows
    • A vertical bar implies an input to or output from a control spec (CSPEC) — a separate specification that describes how control is handled
    • A dashed arrow entering a vertical bar is an input to the CSPEC
    • A dashed arrow leaving a process implies a data condition
    • A dashed arrow entering a process implies a control input read directly by the process
  • Control flows do not physically activate/deactivate the processes—this is done via the CSPEC
uml behavioral modeling
UML: Behavioral modeling
  • Activity Diagrams
  • Statechart Diagrams
  • Interaction Diagrams
slide10

deposit

Over drafted

withdraw

withdraw

deposit

ok

UML: State Diagram

  • Shows the behavior of one object
  • How does it change its state based
  • on the messages it receives,
  • narrowly focused, fine-grained
    • State: condition/situation during
    • lifetime of an object
    • State transition: relationship
    • indicating a state change (atomic &
    • non interruptible)
    • Action: atomic & non-interruptible
slide11

State notation (1)

  • Substates: disjoint/concurrent
  • Entry/exit actions
    • entry: an action that is performed on entry to the state
    • exit: an action performed on exiting the state
  • do: an ongoing activity performed while in the state (example: display window)
    • interruptible
  • on: an action performed as a result of a specific event

State name

state variable(s)

entry: entry action

do: activity-A

on: event-A: action-A

exit: exit-action

slide12

Transition notation (2)

Event(arguments)[condition]/action

State-A

State-B

  • Event: significant occurrence that has a location in time and space
    • triggers the transition
    • signals, calls, passing of time, change in state
  • Guard condition:
      • Transition only eligible to fire when guard evaluates to true
      • Guards of transition exiting one state are mutually exclusive
  • Action: executable atomic computation
slide13

Event(attribute)

State-B

Initial state

State diagram notation (3)

  • Start state
    • No event triggers allowed
    • Branch conditions allowed
    • May not remain in start states
  • End state
    • Top level end state terminates a state machine
slide14

State transitions for an order

get next item[ not all

Item received[ some

items checked ]

items not in stock ]

[ All items checked && some

items not in stock ]

/ get first item

Checking

Waiting

do: check item

[ All items checked &&

Item received[ all items

all items available ]

available ]

Dispatching

Delivered

Delivered

do: initiate delivery

slide15

Example: Payment authorization in class Order

2 parallel processes:

- authorization

- order handling

Authorizing

[ payment not ok ]

do: check payment

[ payment ok ]

Rejected

Authorized

Delivered

slide16

Concurrent state diagram for the class Order

Cancelled

Waiting

Waiting

Dispatching

Dispatching

Checking

Checking

Delivered

Authorizing

Authorizing

Authorized

Authorized

Rejected

statecharts
Statecharts
  • Allow the decomposition of a model into sub-models
  • A brief description of the actions is included following the ‘do’ in each state
  • Can be complemented by tables describing the states and the stimuli
microwave oven state description
Microwave oven state description

State

Description

Waiting

The oven is waiting for input. The display shows the

current time.

Half power

The oven power is set to 300 watts. The display

shows ‘Half power’.

Full power

The oven power is set to 600 watts. The display

shows ‘Full power’.

Set time

The cooking time is set to the user’s input value. The

display shows the cooking time selected and is

updated as the time is set.

Disabled

Oven operation is disabled for safety. Interior oven

light is on. Display shows ‘Not ready’.

Enabled

Oven operation is enabled. Interior oven light is off.

Display shows ‘Ready to cook’.

Operation

Oven in operation. Interior oven light is on. Display

shows the timer countdown. On completion of

cooking, the buzzer is sounded for 5 seconds. Oven

light is on. Display shows ‘Cooking complete’ while

buzzer is sounding.

microwave oven stimuli
Microwave oven stimuli

Stimulus

Description

Half power

The user has pressed the half power button

Full power

The user has pressed the full power button

Timer

The user has pressed one of the timer buttons

Number

The user has pressed a numeric key

Door open

The oven door switch is not closed

Door closed

The oven door switch is closed

Start

The user has pressed the start button

Cancel

The user has pressed the cancel button