Vous êtes sur la page 1sur 82

The Design-Methods

Comparison Project

Terry Bahill
Systems and Industrial Engineering
University of Arizona
Tucson, AZ 85721-0020
terry@sie.arizona.edu
http://www.sie.arizona.edu/sysengr/
Copyright  1998-2010 Bahill
Reference
Terry Bahill, Mack Alford, K. Bharathan, John
Clymer, Doug Dean, Jeremy Duke, Greg Hill,
Ed LaBudde, Eric Taipale, Wayne Wymore and
Sten Dahlberg, The Design-Methods
Comparison Project, IEEE Transactions on
Systems, Man, and Cybernetics, Part C:
Applications and Reviews, Vol. 28, No. 1, pp.
80-103, 1998.

http://www.sie.arizona.edu/sysengr/methods2

12/08/21 2 © 2009 Bahill


To a man with a
hammer,
everything looks
like a nail.*
12/08/21 3 © 2009 Bahill
12/08/21 4 © 2009 Bahill
Mr. Wrong
Wrench

12/08/21 5 © 2009 Bahill


Problem statement*
A farmer on a seldom-used farmroad has difficulty getting across
a busy highway. Design a traffic-light system for this intersection.
Normally, the highway light shall be green and the farmroad light
shall be red. When a sensor signals that a tractor is on the
farmroad, the highway light shall change to yellow. After a short-
time interval (STI, nominally 4 seconds) the highway light shall
change to red and the farmroad light shall change to green. The
farmroad light shall stay green until the tractor clears the sensor or
after a long-time interval (LTI, nominally 40 seconds), whichever
comes first. Then the farmroad light shall become yellow. After a
short time interval the farmroad light shall become red and the
highway light shall become green. The system shall stay that way
for a least a long time interval. After a long time interval the
highway light shall be switched when the sensor detects a tractor.
A timer that produces output signals after short time intervals and
long time intervals will be available. It can be restarted at
anytime.
12/08/21 6 © 2009 Bahill
The intersection
Farmroad
Sensor

Highway
Highway

Sensor

Farmroad
12/08/21 7 © 2009 Bahill
Convenient abbreviations
Control Inputs Meaning
Initialize=1 puts the system in some initial state
Sen =1 sensor is detecting a vehicle on the farmroad
STI=1 short time interval has expired
LTI=1 long time interval has expired

Outputs Meaning
CHWG=1 command highway green light on
CHWY=1 command highway yellow light on
CHWR=1 command highway red light on
CFRG=1 command farmroad green light on
CFRY=1 command farmroad yellow light on
CFRR=1 command farmroad red light on
Restart=1 reset and start the timer

12/08/21 8 © 2009 Bahill


State transition diagram*
STI/Restart
LTI+Sen
STI
Highway-green Farmroad-yellow

100001 001010

LTI Sen/Restart Initialize/Restart LTI+Sen/Restart

Highway-yellow Farmroad-green

010001 001100
STI LTI Sen
STI/Restart

UML: state machine diagram

12/08/21 9 © 2009 Bahill


State transition table
Present State Inputs Next State Flip-flop Inputs Output
Name A(t) B(t) Sen LTI STI A(t+1) B(t+1) JA KA JB KB Restart
HG 0 0 0 dc dc 0 0 0 dc 0 dc 0
HG 0 0 dc 0 dc 0 0 0 dc 0 dc 0
HG 0 0 1 1 dc 1 0 1 dc 0 dc 1
HY 1 0 dc dc 0 1 0 dc 0 0 dc 0
HY 1 0 dc dc 1 0 1 dc 1 1 dc 1
FG 0 1 1 0 dc 0 1 0 dc dc 0 0
FG 0 1 0 dc dc 1 1 1 dc dc 0 1
FG 0 1 dc 1 dc 1 1 1 dc dc 0 1
FY 1 1 dc dc 0 1 1 dc 0 dc 0 0
FY 1 1 dc dc 1 0 0 dc 1 dc 1 1

dc means don’t care

12/08/21 10 © 2009 Bahill


Inputs and outputs

J A  A  Sen  LTI  Sen  LTI 
K A  J B  K B  A  STI
Restart  A  Sen  LTI  A  B  Sen  A  STI
CHWG  A  B
CHWY  A  B
CHWR  B
CFRG  A  B
CFRY  A  B
CFRR  B
12/08/21 11 © 2009 Bahill
Implementation
Sen
Sen Restart

LTI
JA A JB B
Clock Clock
Sen STI
KA A KB B

12/08/21 12 © 2009 Bahill


Testing via an input/output trajectory
Inputs Outputs
Init Sen STI LTI CHWG CHWY CHWR CFRG CFRY CFRR Restart
1 dc dc dc 1
1 0 0 0 0 1
0 0 dc 1 0
1 0 0 0 0 1
0 1 dc 1 1
0 1 0 0 0 1
0 dc 1 dc 1
0 0 1 1 0 0
0 1 0 0 0
0 0 1 1 0 0
0 dc dc 1 1
0 0 1 0 1 0

Time runs from top to bottom

12/08/21 13 © 2009 Bahill


ASM chart*
Highway- Farmroad
Init
green -yellow
H.CHWG H.CHWR
H.Restart
H.CFRR H.CFRY
0 1 0
LTI Sen STI
1
H.Restart H.Restart
Farmroad-
Highway-yellow green
H.CHWY H.CHWR
H.Restart
H.CFRR H.CFRG
0 1 0
STI LTI+Sen
UML: state machine diagram 1
12/08/21 14 © 2009 Bahill
Wymorian notation1 UML: state machine diagram
The traffic-light controller can be described as
Z = (SZ, IZ, OZ, NZ, RZ), where
/* Items enclosed with /*’s like this are comments */
/* Listing of the possible states */
SZ = {Highway-green, Highway-yellow, Farmroad-green,
Farmroad-yellow}
/* Listing of the four input ports and their legal values */
IZ = I1Z × I2Z × I3Z × I4Z, where

I1Z(Initialize) = {0,1}, /* The legal values for this port are 0 and 1. A 1 on
this port will put the controller in the initial state. */
I2Z(Sen) = {0,1}, /* A 1 at this port means a vehicle was detected on the
farmroad */
I3Z(STI) = {0,1}, /* A 1 at this port means the short time interval has
expired */
I4Z(LTI) = {0,1}, /* A 1 at this port means the long time interval has
expired */
12/08/21 15 © 2009 Bahill
Wymorian notation2
/* Listing of the output ports and their legal values */
OZ = O1Z × O2Z × O3Z × O4Z × O5Z × O6Z × O7Z, where

O1Z(CHWG) = {On, Off} /* Command highway green light on or off */


O2Z(CHWY) = {On, Off} /* Command highway yellow light on or off */
O3Z(CHWR) = {On, Off} /* Command highway red light on or off */
O4Z(CFRG) = {On, Off} /* Command farmroad green light on or off */
O5Z(CFRY) = {On, Off} /* Command farmroad yellow light on or off */
O6Z(CFRR) = {On, Off} /* Command farmroad red light on or off */
O7Z(Restart) = {1, 0} /* Reset and start the timer */

12/08/21 16 © 2009 Bahill


Wymorian notation3*
The next state function lists possible transitions between states.
Each entry shows ((a present state, (an input combination)),
the next state). */
NZ = {((Highway-green, (LTI + Sen)) Highway-green),
((Highway-green, (LTI • Sen)), Highway-yellow),
((Highway-yellow, (STI)), Highway-yellow),
((Highway-yellow, (STI)), Farmroad-green),
((Farmroad-green, (LTI • Sen)), Farmroad-green),
((Farmroad-green, (LTI + Sen)), Farmroad-yellow),
((Farmroad-yellow, (STI)), Farmroad-yellow),
((Farmroad-yellow, (STI)), Highway-green),
((ANY-state, (Initialize)), Highway-green)},

/* The readout function lists the states and the outputs


appropriate for each */
RZ = {(Highway-green, (CHWG, CFRR, Restart)),
(Highway-yellow, (CHWY, CFRR, Restart)),
(Farmroad-green, (CHWR, CFRG, Restart)),
(Farmroad -yellow, (CHWR, CFRY, Restart))}.
12/08/21 17 © 2009 Bahill
Wymore’s notation
If p  IZ, p = (Initialize(p), Sen(p), STI(p), LTI(p)), and x  SZ then NZ(x, p) =
Highway-green-initialize if initial(p) = 1;
Highway-green-wait if x = Highway-green-initial;
Highway-green- wait if x = Highway-green-wait AND LTI(p) = 0;
Highway-green if x = Highway-green-wait AND LTI(p) = 1;
Highway-green if x = Highway-green AND Sen(p) = 0;
Highway-green-transition if x = Highway-green AND Sen(p) = 1;
Highway-yellow if x = Highway-green-transition;
Highway-yellow if x = Highway-yellow AND STI(p) = 0;
Highway-yellow-transition if x = Highway-yellow AND STI(p) = 1;
Farmroad-green if x = Highway-yellow-transition;
Farmroad-green if x = Farmroad-green AND LTI(p)=0 AND Sen(p)=1;
Farmroad-green-transition if x = Farmroad-green AND LTI(p)=1 OR Sen(p)=0;
Farmroad-yellow if x = Farmroad-green-transition;
Farmroad-yellow if x = Farmroad-yellow AND STI(p) = 0;
Farmroad-yellow-transition if x = Farmroad-yellow AND STI(p) = 1;
Highway-green-wait if x = Farmroad-yellow-transition.

12/08/21 18 © 2009 Bahill


LaBudde's block definition diagram
POWER
TRAFFIC LIGHT SYSTEM BLOCK DIAGRAM H/W USER
GENERATING
SYSTEM

OFF

OFF H/W CHWG G


POWER H/W
ON CHWY Y
INPUT LIGHT
PWR CHWR R

MAINTENANCE HEAT ENVIRONMENT


USER

ON/OFF NUMEROUS
INPUTS

AUTO/MANUAL

HEAT

F/R USER F/R USER


OFF

CFRG G
F/R
CFRY Y
LIGHT
CFRR R
F/R

SEN CONTROLLER

12/08/21 19 © 2009 Bahill


UML: state machine diagram
Mode matrix, and timeline
state diagram and timeline*
INITIALIZE
H/W
MODE MATRIX GO

MODE PWR H/W F/R PWR OFF


OFF OFF OFF OFF OFF
T>ST1
SEN*T>LT1+MANUAL
H/W GO ON CHWG CFRR
H/W Yellow ON CHWY CFRR
FAULTS
F/R GO ON CHWR CFRG F/R H/W
F/R Yellow ON CHWR CFRY Yellow Yellow

TIME FAIL ON X X
FAIL X LIGHT
FAILURE LIGHT
ON OUT
MODES OUT X FAIL NOT(SEN)+T>LT1+MANUAL T>ST1

ETC. ? ? ? FAIL MODES


F/R
WRONG GO
DEFINITIONS
TIME
PWR = POWER SWITCH
SEN = FARM ROAD SENSORS
ST1 = SHORT TIME INTERVAL
LT1 = LONG TIME INTERVAL STATE DIAGRAM
MANUAL = MAINTENANCE COMMAND
FAULT = ANY FAILURE CONDITION
* = AND F/R NOT WAITING SCENARIO
+ = OR
CURLY BRACKET = DON'T KNOW H/W
X = DON'T CARE GO

F/R WAITING SCENARIO

H/W F/R F/R H/W H/W


OFF H/W GO
Yellow GO Yellow GO Yellow

ST1 LT1 T>LT1


INITIALIZE SEN T>ST1 T>LT1 SEN
T>ST1
?
NOT(SEN)
TRAFFIC LIGHT TIMELINE
12/08/21 20 © 2009 Bahill
Mission phases
ACQUISITION PHASE INSTALLATION PHASE OPERATING PHASE

PURCHASE INSTALL
ORG ORGANIZATION
ENVIRONMENT

RFP PROPOSAL PEOPLE FARM ROAD


& & HIGHWAY
& PEOPLE
PO'S INVOICES NEW PARTS

NEW PARTS
SUPPLIER INSTALL WORKING
OPERATIONAL
LIGHTS LIGHTS

NEW & REPAIR PARTS


F/R USERS
H/W USERS

PARTS ABNORMAL
INVENTORY MODES
DEFECTIVE &
PARTS RETURN TO POWER
SERVICE GENERATING

MAINTENANCE PHASE DISPOSAL PHASE


WORN
REPAIR
OUT
PARTS
PARTS

UML: block definition diagram

12/08/21 21 © 2009 Bahill


Operating phase scenario
ENVIRONMENT

SOLAR/THERMAL POWER
TEMPERATURE/HUMIDITY GENERATING
SYSTEM TRANSPORTATION
PRECIPITATION/VISIBILITY FARM ROAD
HIGHWAY LIGHTNING SYSTEM
USER
USER ETC. SYSTEM
SYSTEM
VOLTS AMPS

HEAT
TRAFFIC
LIGHT
H/W DRIVER F/R DRIVER
ELEMENT
ELEMENT ELEMENT
-OFF
-VELOCITY -VELOCITY
H/W -H/W GO F/R
-ACCEL -ACCEL
-H/W Yellow
-DE-ACCEL -DE-ACCEL
-F/R GO
-STOP -STOP
-F/R Yellow
-FAULTS
GAS BRAKE GAS BRAKE
T<ST1

H/W F/R
VEHICLE BRAKE VEHICLE
ELEMENT ELEMENT

WEIGHT FRICTION VELOCITY DE-ACCEL STOP


WEIGHT FRICTION

Y Td V=0
HIGH WAY
NEURO- FARM ROAD
ELEMENT
MUSCULAR ELEMENT
RESPONSE
TIME
H/W USER Yellow MODE TIMELINE

UML: block definition diagram


12/08/21 22 © 2009 Bahill
RDD-100* UML: sequence diagram
&
sensor farmroad
controllers timer highway light
light
number of arrivals
@ @ @ @ @

1 8 6
11
tractor 2 CHWY=1 wait for
arrives sen=1 timer reset show HG show FR
wait for
tractor
7 12 14
tractor start=1 L reset
departs sen=0 show HY show FG
3 9
13 15
turn highway STI=1 delay for
@ red, farmroad STI show HR show FY
green timeout STI
10

CFRG=1 delay for


LTI @ @
timeout LTI
reset arrived
17
CHWR=1
G reset output LTI
4
START=1
turn (2)
farmroad
yellow
+
LTI=1

@
CFRY=1

5
turn CWHG=1
farmroad
red,
highway
green
CFRR=1
16
wait for
LTI

@
&

12/08/21 23 © 2009 Bahill


Entity relationship diagram
Sensor FRLight HWLight
2 Uses 2 Controls 2 Controls
1 1 1
1 Uses 1
Controller Timer

UML: class diagram

12/08/21 24 © 2009 Bahill


Data flow diagram*
CommandFRLight CommandHWLight

Color Color
Acknowledge/Error Acknowledge/Error
WaitForEvent
STI
Road
Status TimeCommand LTI

Sensor ResetTimer

Symbology Legend
UML:
Event Process activity
Data diagram?
External Entity

12/08/21 25 © 2009 Bahill


UML: state machine
diagram
State transition diagram*
System Initialization
>Init Completed
>>Sensing
[Command HWLight(Green)
[Command FRLight(Red)

Waiting for Sensor signal


>Sensor Trigger And LTI Signal
>>Timing
[Reset Timer
[CommandHWLight(Yellow)
Waiting for STI Signal
>STI Signal
[Command HWLight(Red)
[CommandFRLight(Green)
Symbology Legend [Reset Timer
>Wait for this Event
Waiting for no Vehicle OR LTI
>>Enable this operation
<<Disable this operation >LTI Signal >Sensor Clear
[ Trigger this operation [CommandFRLight(Yellow) [CommandFRLight(Yellow)
[Reset Timer [Reset Timer
State
Waiting for STI signal
>STI Signal
[Command FRLight(Red)
[CommandHWLight(Green)
<<Timing

12/08/21 26 © 2009 Bahill


Functional decomposition
5. Wait for 11. Wait for
sensor signal LTI signal

6. Wait 12. Wait for


7.* Command 8. Wait for sensor_clear 13. Command 14. Wait for
1.* INIT for LTI AND HW light yellow STI signal OR FR light yellow STI signal
signal signal

2. Command 2. Command
HW light green 4. Reset 9. Command 4. Reset HW light green
timer HW light red timer
3. Command 3. Command
FR light red 10. Command FR light red
FR light green
4. Reset timer 4. Reset timer
4. Reset timer

UML: activity diagram

12/08/21 27 © 2009 Bahill


Decomposition of 1.* INIT
1.1* Obtain 1.2 Obtain
1.3 Obtain lights- 1.4 Begin system
controller hardware- controller software-
OK signal OK signal opertation
OK signal

ON_FAIL ON_FAIL ON_FAIL ON_FAIL

1.5 Signal ERROR

12/08/21 28 © 2009 Bahill


Decomposition of 1.1* Obtain
controller hardware-OK signal*
1.1.1 Get 1.1.2 Get 1.1.3 Get
timer OK I/O ports ROM OK
signal OK signal signal

ON_FAIL ON_FAIL ON_FAIL

1.5 Signal ERROR

12/08/21 29 © 2009 Bahill


But

Object Orientated Design

Functional Design

12/08/21 30 © 2009 Bahill


Information model
indicates resets and
Sen reacts to
Traffic
Sensor < r2 > < r3 > Timer
reacts to Light indicates
detected by STI/LTI

< r1 > is-a


detects

Highway Farmroad
Tractor
Light Light

UML: class diagram

12/08/21 31 © 2009 Bahill


State model for farmroad lights
Farmroad_Light_R INIT
CFRR1
CFRY0
CFRG0 STI=1
Signal Y to highway SM
Farmroad_Light_Y

CFRR0
X CFRY1
CFRG0
Farmroad_Light_G Restart

CFRR0
LTI=1
CFRY0
CFRG1
Restart Sen=0

UML: state machine diagram


12/08/21 32 © 2009 Bahill
State model for highway lights
HW_Light_G_and_sleeping HW_Light_R
INIT
CHWR0
Y CHWR1
CHWY0
CHWY0
CHWG1
CHWG0
Restart
signal X to farmroad SM

LTI=1 STI=1

HW_Light_G_and_watching HW_Light_Y

CHWR0 Sen=1 CHWR0


CHWY0 CHWY1
CHWG1 CHWG0
Restart

UML: state machine diagram

12/08/21 33 © 2009 Bahill


Class descriptions*
Class Name Class Description
A sensor can determine the presence of a vehicle at a certain location on the
Sensor
roadway.
Timer A timer can count for a specified number of seconds, then send a signal.
A traffic light has three colored lights, red, green, and yellow. Exactly one
Traffic Light
light is on at all times, unless the signal is malfunctioning.
Light A light can be turned on or off, and has a particular color associated with it.
A vehicle travels on a roadway. It will pass through an intersection if the
Vehicle
light is green and will stop if the light is red. Sensors detect its presence.
Road Way A road way allows vehicles to operate on a smooth surface.
A pair router provides an interface for a particular traffic signal. All
Pair Router
requests for light changes must go through the router.
The controller manages the intersection’s lighting sequence. It interfaces
Controller
with the sensors and the timer.

12/08/21 34 © 2009 Bahill


Class diagram
Light

Red Light Yellow Light


Green Light
uses

has-a
Traffic Light
inheritance

Timer Pair Router Sensor

Controller

12/08/21 35 © 2009 Bahill


Sequence diagram
Sensor Controller HW Router HW Lights FR Router FR Lights

Car waiting
Change to red
Change color
Confirmed

Change to green
Change color

Confirmed

No car
Change to red
Change color

Confirmed
Change to green

Change color
Confirmed

12/08/21 Time runs from top to bottom36 © 2009 Bahill


OpEM directed graph model
B E UML: activity
INITIALIZE

BEGIN
OPERATION
<1>
<3> END
diagram?
OPERATION

CREATE TRACTOR
AR EN
<2>
V TRACTOR
ARRIVES
D 1
DE:LETE
FR GREEN TRACTOR
(TWT TC CL
<1> <2>
) TRACTOR BEGINS
TO CROSS
R TRACTOR
CLEAR
R 2

EACH
TRACTO
R
TRACTOR
WAITING
CHWY
GH YH
<1> (GHW) <2>
W LTI Complete HW YELLOW W
CFRG &
CHWR
<3>
TRACTOR CLEAR FR GREEN
OR LTI COMPLETE

RESET &
[GFR] CFRY CHWG
FR <4> &CFRR
YELLOW
YFR <5> IDL
HW GREEN 3

12/08/21 37 © 2009 Bahill


IDEF0* Interval
Duration Light Control
Policy Policy
Approaching
FR Vehicle
UML: activity diagram
Road Status
Monitor
Farm Road
Invoke Timer Msg.
Traffic
A1

Count Down
LTI
Road Time
Sensor Clock Intervals STI
Pulses A2

Control HW Light Change Commands


Timer Lights FR Light Change Commands
A3

FR Projected
Project
Signal Lights
Farm Road
Signal
Symbol Legend Controller
Lights A4
Controls HW Projected
Project Signal Lights
Farm Highway
Road Signal
Traffic Lights A5
Inputs Activity Outputs Light

Highway
Mechanisms Traffic
Light

12/08/21 38 © 2009 Bahill


Functional flow block diagrams
by Sten O. Dahlberg
Boeing Information, Space and Defense Systems
(This solution is not in the IEEE SMC paper. It is on the
web site.)

12/08/21 39 © 2009 Bahill


System interface diagram
Interface

Highway
Sensors
Lights
Controller
System
Farmroad
Timer
Lights

UML: block definition diagram

12/08/21 40 © 2009 Bahill


Functional interface diagram
Command Green ON
Highway
Sensors Detect Tractor Command Yellow ON
Command Red ON
Lights
Controller
System
Short Time Over
Long Time Over Command Green ON
Timer Farmroad
Command Yellow ON
Restart Lights
Command Red ON

The black rectangle indicates the owner of the interface

UML: block definition diagram

12/08/21 41 © 2009 Bahill


Who should own the interface?
• COTS
• Sender
 especially in broadcast mode
• Requirements owner
• Systems engineering
• DoE
• Bigger
• Smarter
• Least flexible
• Hardware
• The Boss
12/08/21 42 © 2009 Bahill
Functional Flow Block Diagram

UML: activity diagram

12/08/21 43 © 2009 Bahill


Operational Sequence Diagram
6.0 2.2
Indicate Start
Long Time Timer
Elapsed
TIMER CONTLR

5.0
Detect
Tractor
1.0 2.1 2.2 3.1 3.2 4.0 Clear
Detect Cmd.Hwy. Start Indicate Cmd. Hwy. Cmd. Farm
OR Light Timer Short Time Light SENSOR OR
Tractor Light Green
Yellow Elapsed Red
SENSOR CONTLR CONTLR TIMER CONTLR CONTLR 6.0
LTI
Elapsed

TIMER

7.0 2.2 3.1 8.0 9.0


Cmd. Farm Start Indicate Cmd. Farm Cmd. Hwt
Light yellow Timer Short Time Light Light Green
Elapsed Red

CONTLR CONTLR TIMER CONTLR CONTLR

UML: activity diagram

12/08/21 44 © 2009 Bahill


Assigning functions
to physical components
• It’s OK to assign many functions to one
physical component.
• But it might be a mistake to assign one
function to two components.*

12/08/21 45 © 2009 Bahill


Problem solving methods*
Backward chaining
• The medicine man has a 4-ounce bottle and a
9-ounce bottle, but I want exactly six-ounces
9 ounces
of Kickapoo Joy Juice.
• How does the medicine
man meet my needs?

4 ounces

12/08/21 46
Implementation1
• Systems engineers use high-level tools for high-
level design.
• Specialty design engineers implement the system.
• The design may change between high-level design
and low-level implementation.
• We implemented 3 designs in hardware.
• The design did not change for the State Transition
Diagram solution.
• The design did not change for Eric Taipale’s
solution.

12/08/21 47 © 2009 Bahill


Implementation2
• The object-oriented design could not be
implemented on the single-threaded
operating system.
• The design had to be changed
significantly.
• Not surprisingly, the method substantially
effects the implementation.

12/08/21 48 © 2009 Bahill


Comparison metrics
• The Traffic Light Problem had pulse outputs (Mealy
machine) and level outputs (Moore machine).
• All tools were able to handle this difficulty.
• Another metric is complexity, quantified by the
number of inputs, outputs, states and interface
connections.
• The distinguishing characteristic of our second
problem is concurrency.

12/08/21 49 © 2009 Bahill


Other comparison metrics
• simplicity
• apparent ease of alterations
• effort in learning
• hand-off-ability
• communicability
• implementability
• design changes made during implementation
• ease of handling both pulse and level outputs
• ease of showing all or only some transitions, outputs etc
• condensability
• size of documentation
• scalability between large and small problems
• intrusion on the designer
• comprehensiveness
• ease of handling concurrent processes
12/08/21 50 © 2009 Bahill
Control and data inputs
• Most methods differentiate between control
and data inputs.
• Control inputs: Initialize, Sensor, Short-Time
Interval and Long-Time Interval.
• Data (or material) inputs: Tractor, Electric
Power, Heat and Repair Parts.

12/08/21 51 © 2009 Bahill


Objects, states and functions
• Objects (components) should be named with
noun phrases, e.g. Red Light.
• States should be named with historical
statements such as HW Light Green, Sen
Received, Waiting for LTI.
• Functions should be named with verb phrases,
e.g. DetectTractor.

12/08/21 52 © 2009 Bahill


Most methods
focus on only one aspect
Object-Oriented methods concentrate on objects
and seem to ignore functions and states.

12/08/21 53 © 2009 Bahill


Focus on only one (cont.)
• State Transition Diagrams concentrate on
states and functions and seem to ignore
objects.
• You should use other diagrams to show the
objects.

12/08/21 54 © 2009 Bahill


N-squared chart (objects)*
Sen
Sensor

STI
Timer
LTI

CHW
Controller
Restart CFR

Traffic
Lights

12/08/21 55 © 2009 Bahill


UML: block
Block Tractor
definition diagram
diagram Tractor
Status The interface
(objects) object is on the
boundary line
Sensor

Sen
CFRG
CFRY
Highway CFRR Farmroad
Controller
Lights CHWG Lights
CHWY
CHRR
Restart STI
LTI

Timer

12/08/21 56 © 2009 Bahill


Boundary
• Defining the boundary of the system is an important
and difficult task.
• The system’s inputs and outputs cross the boundary.
• Defining the boundary gives rise to the interfaces.
• In the previous slide, if we expand the boundary to
include the highway and farmroad lights, then the
inputs, outputs and interfaces change.

12/08/21 57 © 2009 Bahill


Focus on only one (cont.)*
Functional Analyses focus on functions and objects,
but seems to ignore the states.

Tractor Detect Sen Wait for


Tractor sensor signal

12/08/21 58 © 2009 Bahill


Focus on only one (cont.)
• IDEF0 shows the objects and the functions, but
seems to ignore the states.

• Structured Analysis uses Entity Relationship


Diagrams to focus on the objects, Data Flow
Diagrams to focus on the functions, and State
Transition Diagrams to focus on the states.

12/08/21 59 © 2009 Bahill


Problem solving methods*
Brute force enumeration
My friend says, “I have three daughters. The
product of their ages is 72. Can you tell me
how old they are?”
How did I solve this problem?

12/08/21 60 © 2009 Bahill


Which method is best?
Each designer thought that his
method was the best.

12/08/21 61 © 2009 Bahill


Which is best?
• Object-oriented methods may be best for modeling
existing physical systems.
• Non-engineers, like physicians and nurses, relate to
objects like nurse, managing physician, and patient
record more readily than functions like obtain
committee approval or request referral.
• Archaeologists studying Stonehenge and Machu Picchu
easily describe the objects, but have difficulty defining
the functions.

12/08/21 62 © 2009 Bahill


A communications aid
• To aid communications you should learn the
background of the person you are communicating
with.
• Airplane designers are probably object-oriented. They
think of wings, engines, cabin accessories, etc.
• A software engineer designing an editor may think in
terms of functions, functions like insert, delete, copy,
paste, move, save, print, find, etc.

12/08/21 63 © 2009 Bahill


Are you object-oriented or functional?
• If I ask you to change your last homework, would you
 go to the Start Menu, select Word, Excel, Power
Point, Visio, etc. and then open your file? If so, then
you chose the function you wanted to perform.
 open Windows Explorer, go to the directory
containing your homework and double click on the
file? If so, you chose the object you wanted to work
on.

12/08/21 64 © 2009 Bahill


What have we learned
so far in this seminar?
• You should use multiple views.
• For any system design, you should use
multiple views to ensure that all objects,
functions and states are identified.

12/08/21 65 © 2009 Bahill


Blueprints for a house
• Site plan
• Floor plans
• Exterior elevations
• Interior elevations
• Basement schedule
• Electrical schematics
• Plumbing drawings

12/08/21 66 © 2009 Bahill


Integrate
• Is there a way to integrate the two dozen
different design methods presented in this
paper?
• The UML integrated these methods and
consolidated them down to 9 diagrams.

12/08/21 67 © 2009 Bahill


The Unified Modeling Language (UML)
uses 9 primary diagrams*
• External
 Use Case diagrams
 Use Cases
• Internal
 Class diagrams
• Dynamic
 Interaction diagrams
 Sequence diagrams
 Communication diagrams
 Activity diagrams
 State machine diagrams
• Package diagram
• Reference: Fowler, M.,UML Distilled: A brief guide to the standard
object modeling language, Third Edition, Addison-Wesley, 2004.

12/08/21 68 © 2009 Bahill


Use case diagram

IntervalDuration
Policy
FarmroadLights

<<extends>>

Neighboring ControlLights
TrafficSignal ControlBrokenLights

synchronize()

DetectTractor

Tractor HighwayLights

12/08/21 69 © 2009 Bahill


Use case
Name: Control Lights
Added value: The Farmer can get across the highway
Primary actor: Farmer
Supporting Actors: Highway and Farmroad Lights
Preconditions: Before execution, the following must be true
System hardware is powered on and functioning properly
System is in the Highway Green state
System software is in the normal state
Description:
1. This use case begins after the Init signal puts the system in the Highway Green
State. (This could be put in the "Trigger.")
2. After a long-time interval (LTI, nominally 40 seconds) has expired AND a
Sensor signals that a tractor is on the farmroad, the system shall command the
HighwayLight to change to yellow (CHWY).
3. After a short-time interval (STI, nominally 4 seconds) the system shall command
the HighwayLight to change to red (CHWR) and the FarmroadLight to change to
green (CFRG).
4. The FarmroadLight shall stay green until the tractor clears the Sensor OR after a
long-time interval, whichever comes first. Then the system shall command the
FarmroadLight to become yellow (CFRY).

12/08/21 70 © 2009 Bahill


Control Lights use case (continued)
Description: (continued)
5. After a short time interval, the system shall command the
FarmroadLight to become red (CFRR) and the HighwayLight to
become green (CHWG). The system shall now go to step 2 and
repeat.
6. This use case ends on malfunction.
Specific requirements
Functional requirements
FR1: The system shall have the capability of turning on
and off the red, green and yellow farmroad
and highway lights
Supplementary requirements
SR1: The system shall have built-in self-test

12/08/21 71 © 2009 Bahill


Class diagram
Timer

STI()
LTI()
Controller

ControlLights()
CHWG()
CHWY()
CHWR()
CFRG() <<Interface>>
CFRY() Sensor
CFRR()
Restart() TractorStatus

DetectTractor()

12/08/21 72 © 2009 Bahill


Sequence diagram
Sensor Controller HighwayLights FarmroadLights

DetectTractor()

CHWR()

Confirm()

CFRG()

Confirm()

Time runs from top to bottom

12/08/21 73 © 2009 Bahill


Communication diagram
Farmroad
Lights

4: CFRG()

5: Confirm()
1: DetectTractor()
Sensor Controller

2: CHWR()

3: Confirm()
Highway
Lights

12/08/21 74 © 2009 Bahill


State machine diagram
INIT
HWR
HWGSleeping Y do: CHWR()
do: CHWG() entry: SignalX()
entry: Restart() entry: Restart()
LTI STI
Sen HWY
HWGWatching
entry: Restart()
do: CHWG()
do: CHWY()

FRR
do: CFRR()
entry: SignalY()
STI
entry: Restart()

FRG LTI + Not Sen FRY


entry: Restart() entry: Restart()
do: CFRG() do: CFRY()

12/08/21 75 © 2009 Bahill


Software reuse*
• When can we safely reuse software?
• Don’t ever reuse code!
• Do reuse models.

12/08/21 76 © 2009 Bahill


This is cool.
After I
generalize it
Software
Can I use it?
and make it
robust.
Reuse
Scheme

B A

App A App B App A App B App A App B

Generalize

Copy
Application Layer

uses
s

s
use

use
Domain Layer

Time
Commercial tools
• Visio
• IBM Rational Rose
• Enterprise Architect
We have a site license for EA

12/08/21 78 © 2009 Bahill


Summary
• You must use multiple aspects to describe a system.
• At a minimum you need inputs, functions, outputs,
interfaces, objects and states.
• The UML can model all the necessary aspects.
• But you should not use all features of UML. Use only
those that are necessary to communicate your design.
• A weakness of UML is in modeling inputs* and
outputs.

12/08/21 79 © 2009 Bahill


Problem solving methods*

12/08/21 80 © 2009 Bahill


The bear
• A hunter in his camp sees a bear one mile
south of him.
• He stalks the bear but by the time he gets to
that point, the bear has moved one mile east.
• He shoots the bear and then drags it one mile
north back to his camp.
• What color was the bear?

12/08/21 81 © 2009 Bahill


12/08/21 82 © 2009 Bahill

Vous aimerez peut-être aussi