lesson 33: std -- development & testing procedures

16
STD -- Development & Testing Procedures - Page L33- 2003 Dr. M.E. Fayad Lesson 33: STD -- Development & Testing Procedures Object- Oriented Modeling & Applicatio ns

Upload: macey-wise

Post on 30-Dec-2015

24 views

Category:

Documents


2 download

DESCRIPTION

Lesson 33: STD -- Development & Testing Procedures. Object-Oriented Modeling &. Applications. Lesson Objectives. Understand STD development procedures Understand some of the common errors that are made in constructing STDs List and discuss some practical tips about dynamic modeling. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Lesson 33: STD -- Development & Testing Procedures

STD -- Development & Testing Procedures - Page L33-1

2003 Dr. M.E. Fayad

Lesson 33:STD -- Development & Testing

Procedures

Lesson 33:STD -- Development & Testing

Procedures

Object-Oriented

Modeling &

Applications

Page 2: Lesson 33: STD -- Development & Testing Procedures

STD -- Development & Testing Procedures - Page L33-2

2003 Dr. M.E. Fayad

Lesson ObjectivesLesson Objectives

Understand STD development procedures

Understand some of the common errors that are made in constructing STDs

List and discuss some practical tips about dynamic modeling

Objectives

Page 3: Lesson 33: STD -- Development & Testing Procedures

STD -- Development & Testing Procedures - Page L33-3

2003 Dr. M.E. Fayad

STD Development Procedures

• Identify external events from the Context Diagrams

– A discrete data item arrives

– A required time passed

– A recognition device signals an event

• Use scenarios

• Identify state from DFDs

• Add Idle state to the list of states

Page 4: Lesson 33: STD -- Development & Testing Procedures

STD -- Development & Testing Procedures - Page L33-4

2003 Dr. M.E. Fayad

STD Development Procedures (con’d)

• Combine states and events into a STD

• Identify actions that need to be performed after each event

• Identify states that split into substates

• Use an action table to check for missing states and events

• Walkthrough the STD with users to verify it

Page 5: Lesson 33: STD -- Development & Testing Procedures

STD -- Development & Testing Procedures - Page L33-5

2003 Dr. M.E. Fayad

Testing a STD

• Five clues

1. No transition out of a state

2. No transition into a state

3. The STD is too complicated

4. Ambiguous or unclear event names

5. Events with continuous instead of discrete signals

Page 6: Lesson 33: STD -- Development & Testing Procedures

STD -- Development & Testing Procedures - Page L33-6

2003 Dr. M.E. Fayad

No Transition Out of a State

Clue # 1: No transition out of a state

Cause: An event & transition line have been omitted

Cure: Identify the event and add the transition

Start Stop

Idle State

Heating

Cooling

ColdEnable Heat

WarmDisable Heat

HotEnable Cooling

Start Stop

Idle State

Heating

Cooling

ColdEnable Heat

WarmDisable Heat

HotEnable Cooling

OKDisable Cooling

A STD in which the Cooling state has no exit

Page 7: Lesson 33: STD -- Development & Testing Procedures

STD -- Development & Testing Procedures - Page L33-7

2003 Dr. M.E. Fayad

No Transition Into a State

Clue # 2: No transition into a state

Cause: An event & transition line have been omitted

Cure: Identify the event and add the transition

A STD with no way to get into the Cooling state

StartStop

Idle State

Heating

Cooling

ColdEnable Heat

WarmDisable Heat

ColdEnable Heat

StartStop

Idle State

Heating

Cooling

ColdEnable Heat

WarmDisable Heat

ColdEnable Heat

HotEnable Cool

Page 8: Lesson 33: STD -- Development & Testing Procedures

STD -- Development & Testing Procedures - Page L33-8

2003 Dr. M.E. Fayad

The STD is Too Complicated

Clue # 3: The STD is too complicated.

Cause: The STD should be redrawn in multiple levels

Cure:

• Identify independent group of states and give them a group name

• Each group can then be redrawn in detail on separate diagrams

• Such leveling reduces the complexity of the diagrams and make easier for the reader to identify the different processes that are being controlled.

Page 9: Lesson 33: STD -- Development & Testing Procedures

STD -- Development & Testing Procedures - Page L33-9

2003 Dr. M.E. Fayad

The STD is Too Complicated (cont’d)

StartStop

Idle State

Gas Heating

Electric Heating

ColdEnable Gas

ColdEnable Gas

Refrigeration

Adding Base

Adding Acid

Cold or CoolEnable Electric

CoolDisable Gas

OKDisable Electric

HotEnable Refrig’n

Cold oe CoolDisable Refrig’n

HotDisable ElectricEnable Refrig’n

AcidEnable Base OK

Disable Base

OKDisable Acid

BasicEnable Acid

Page 10: Lesson 33: STD -- Development & Testing Procedures

STD -- Development & Testing Procedures - Page L33-10

2003 Dr. M.E. Fayad

The STD is Too Complicated (cont’d)

StartStop

Idle State

Control Temperature

Wrong TemperatureEnable Control

Control pH

Temperature OKDisable Control Wrong pH

Enable pH Control

pH OKDisable

pH Control

This STD combines two control functions that should be separated and leveled. Control Temperature and Control pH can then be zoomed separately

Page 11: Lesson 33: STD -- Development & Testing Procedures

STD -- Development & Testing Procedures - Page L33-11

2003 Dr. M.E. Fayad

Ambiguous or Unclear Event Names

Clue # 4: Ambiguous or unclear event namesCause: Not identified

Cure: Identify all the events and include them in the STD

Start Stop

Idle State

Signal Processing

Signal ArrivesProcess Signal

FinishedEnd Processing

Signal Arrives and Finished are not clearly defined events

StartStop

Idle State

Heating

Cooling

ColdEnable Heat

WarmDisable Heat

ColdEnable Heat

HotEnable Cool

Page 12: Lesson 33: STD -- Development & Testing Procedures

STD -- Development & Testing Procedures - Page L33-12

2003 Dr. M.E. Fayad

Events with Continuous Instead of Discrete Signals

Clue # 5: Events with continuous instead of discrete signalsCause: A signal is not an event. It is a raw data stream.

Cure: Extract the events triggered by special data values

StartStop

Idle State

Control Temperature

TemperatureControl

Control pH

TemperatureDisable Control

pHControl pH

pHEnable Idle

Page 13: Lesson 33: STD -- Development & Testing Procedures

STD -- Development & Testing Procedures - Page L33-13

2003 Dr. M.E. Fayad

Events with Continuous Instead of Discrete Signals (cont’d)

StartStop

Idle State

Control Temperature

Wrong TemperatureEnable Control

Control pH

Temperature OKDisable Control Wrong pH

Enable pH Control

pH OKDisable

pH Control

Temperature and pH are not events. They are continuous data streams.

Page 14: Lesson 33: STD -- Development & Testing Procedures

STD -- Development & Testing Procedures - Page L33-14

2003 Dr. M.E. Fayad

Practical Tips

• Only construct STDs for classes with meaningful dynamic behavior.

– Not all classes require a STD.

• Check the various STDs for consistency on shared events so that the full dynamic model will be accurate.

– Check for redundancy

• Use scenarios to help you construct STDs

• Distinguish between activities and actions. – Activities occur over a period of time.

– Actions are instantaneous compared to the time scale of an application.

• Distinguish between events and conditions

Page 15: Lesson 33: STD -- Development & Testing Procedures

STD -- Development & Testing Procedures - Page L33-15

2003 Dr. M.E. Fayad

Practical Tips

• Use nested states when the same transaction applies to many states

• Most concurrency arises from object aggregation and need not be expressed explicitly in the STD.

– Use composite states to show independent facets of the behavior of a single object

• Try to make the STDs of subclasses independent of the STDs of their superclasses.

– The subclass STDs should concentrate on things unique to the subclasses.

• Beware of unwanted race conditions in the STDs– Race conditions may occur when a state can accept events from

more than one object.

Page 16: Lesson 33: STD -- Development & Testing Procedures

STD -- Development & Testing Procedures - Page L33-16

2003 Dr. M.E. Fayad

Define nested states and race conditions

describe how to construct a STD.

Discussion QuestionsDiscussion Questions