Microwave Oven 3 PDF
Microwave Oven 3 PDF
Microwave Oven 3 PDF
R.G. Dromey,
Software Quality Institute, Griffith University,
Nathan, Brisbane, Qld., 4111, AUSTRALIA
[email protected]
Abstract
Despite the advances in software engineering since 1968,
current methods for going from a set of functional
requirements to a design are not as direct, repeatable and
constructive as we would like. Progress with this
fundamental problem is possible once we recognize that
individual functional requirements represent fragments of
behaviour, while a design that satisfies a set of functional
requirements represents integrated behaviour.
This
perspective admits the prospect of constructing a design
out of its requirements. A formal representation for
individual functional requirements, called behavior trees
makes this possible.
Behaviour trees of individual
functional requirements may be composed, one at a time,
to create an integrated design behaviour tree. From this
problem domain representation it is then possible to
transition directly and systematically to a solution domain
representation of the component architecture of the system
and the behaviour designs of the individual components
that make up the system both are emergent properties.
Finding deep simplicities in a complex logical task
leads to work reduction- Harlan Mills.
1. Introduction
A great challenge that continues to confront software
engineering is how to go in a systematic way from a set of
functional requirements to a design that will satisfy those
requirements. In practice, the task is further complicated
by defects in the original requirements and, subsequent
changes to the requirements.
A first step towards taking up this challenge is to ask
what are functional requirements? Study of diverse sets of
functional requirements suggests it is safe to conclude that
individual requirements express constrained behaviour.
By comparison, a system that satisfies a set of functional
requirements exhibits integrated constrained behaviour.
The latter behaviour of systems is not inherently different.
Therefore, can the same formal representation of
behaviour be used for requirements and for a design? If it
could it may clarify the requirements-design relationship.
2. Behavior Trees
The Behavior Tree Notation captures in a simple treelike form of composed component-states what usually
needs to be expressed in a mix of other notations.
Behavior is expressed in terms of components realizing
states, augmented by the logic and graphic forms of
conventions found in programming languages to support
composition, events, control-flow data-flow, threads, and
constraints. Behavior trees are equally suited to capture
behavior expressed in natural language functional
requirements as to provide an abstract graphical
representation of behavior expressed in a program.
LIGHT
[ On ]
COMPONENT
[ State ]
tag
COMPONENT
[Attribute := Value]
tag
COMPONENT
[ Sub-cpt [ State ] ]
tag
COMPONENT
? IF-State ?
tag
COMPONENT
?? WHEN-State ??
tag
COMPONENT
< Dataflow-State >
tag
System-Name
[ State ]
Internal State
Semantics
Indicates that the component
has realized the particular
internal state. Passes control
w hen state is realized
Attribute - State
Container - State
IF - State
WHEN - State
Data-out State
System - State
Interaction Axiom
For each individual functional requirement of a system,
expressed as a behavior tree, the precondition it needs to
have satisfied in order to exhibit its encapsulated
behavior, must be established by the behavior tree of at
least one other functional requirement that belongs to the
set of functional requirements of the system. (The
functional requirement that forms the root of the design
behavior tree, is excluded from this requirement. The
external environment makes its precondition applicable ).
Interaction Axiom
Py
Matching
Precondition
Px
BT-y
In t eg
ratio
Px
BT-x
Requirem ent-7
If the oven times-out the light and the
pow er-tube are turned off and a beeper
emits a sound to indicate that cooking has
finished.
R7
LIGHT
[Off]
R7
+
OVEN
[Cooking ]
R7
OVEN
?? Timed-Out ??
R7
POWER-TUBE
[Off]
R7
BEEPER
[Sounded]
R7
OVEN
[Cooking-Finished
Requirement-2
Requirement-3
R1
OVEN
[Idle]
R2
OVEN
[Cooking]
R3
C
DOOR
[ Open ]
R1
USER
??Button-Push??
R2
+
USER
??Button-Push??
R3
C+
BUTTON
[ Disabled ]
R1
BUTTON
[Pushed]
R2
BUTTON
[Pushed]
OVEN
[Extra-Minute]
R3
C+
R1
R2
DOOR
[Closed]
POWER-TUBE
[Energized]
OVEN ^
[Cooking]
R3
C+
R1
R2
+
BUTTON
[Enabled]
OVEN
[Cooking]
Requirement-4
Requirement-5
Requirement-6
R4
C
DOOR
[Open ]
R5
+
OVEN
[Cooking]
R6
+
OVEN
[ Open ]
R4
C
LIGHT
[On ]
R5
+
USER
??Door-Opened??
R6
+
USER
??Door-Closed??
R5
R4
C
DOOR
[Open]
R6
OVEN
[Cooking ]
DOOR
[Closed]
R5
+
POWER-TUBE
[Off]
R6
LIGHT
[Off]
R5
OVEN
[Cooking-Stopped]
R6
+
OVEN
[Idle]
R4
C
LIGHT
[On ]
NOTE:
Example Integration
To illustrate the process of requirements integration we
will integrate requirement R6, with part of the constraint
Requirement R3C to form a partial design behaviour tree
(DBT). This is straightforward because the root node (and
precondition) of R3C, DOOR[Closed] occurs in R6. We
integrate R3C into R6 at this node. Because R3C is a
constraint it should be integrated into every requirement
that has a door closed state (in this case there is only one
such node). The result of the integration is shown below.
R6
+
OVEN
[ Open ]
R6
+
USER
??Door-Closed??
R6
@
DOOR
[Closed]
R6
R6
+
LIGHT
[Off]
Point of
Integration (@)
R4
C
R3
C+
BUTTON
[Enabled]
OVEN
[Idle]
LIGHT
[ On ]
OVEN
[ Open ]
R6
+
USER
??Door-Closed??
R6
@
DOOR
[Closed]
R6
LIGHT
[Off]
R6
1
@+
OVEN
OVEN
[Idle]
[Idle]
R3
C+
BUTTON
[Enabled ]
R1
USER
??Button-Push??
R8
-
USER
??Door-Opened??
R1
@
BUTTON
[Pushed]
R8
-
DOOR
[Open]
R1
POWER-TUBE
[Energized]
R8
-
BUTTON
[Disabled]
R1
1
@
OVEN
[Cooking]
R8
-
OVEN ^
[Open]
R8
-
LIGHT
[ On ]
R7
OVEN
?? Timed-Out ??
R2
+
USER
??Button-Push??
R5
+
USER
??Door-Opened??
R2
BUTTON
[Pushed]
R5
@
DOOR
[Open]
R7
LIGHT
[Off]
R7
POWER-TUBE
[Off]
R2
OVEN
[Extra-Minute]
R5
+
POWER-TUBE
[Off]
R3
C
BUTTON
[Disabled ]
R7
BEEPER
[Sounded]
R2
+
OVEN ^
[Cooking]
R5
OVEN
[Cooking-Stopped]
R7
OVEN
[Cooking-Finished
R6
+
Evolving Component
Interaction Network
STEP 8
R4
C
LIGHT
[On]
R6
+
OVEN
[Open ]
R6
+
USER
??Door-Closed??
R6
@
DOOR
[Closed]
R6
LIGHT
[Off]
R6
@
OVEN
[Idle]
OVEN
USER
R3
C+
BUTTON
[Enabled]
DOOR
DOOR
[Closed]
BUTTON
3C BUTTON
[Enabled]
R1
USER
??Button-Push??
R8
-
USER
??Door-Opened??
R1
BUTTON
[Pushed]
R8
DOOR
[Open]
R1
POWER-TUBE
[Energized]
R4
C
LIGHT
[On]
R3
C
LIGHT
BUTTON
[Disabled]
POWER-TUBE
OVEN
USER
DOOR
DOOR
[Closed]
BUTTON
3C BUTTON
[Enabled]
LIGHT
POWER-TUBE
OVEN
[ Open ]
R6
+
USER
??Door-Closed??
R6
@
DOOR
[Closed]
R6
R4
C
LIGHT
[ On ]
LIGHT
[Off]
R3
C+
BUTTON
[Enabled ]
R6
1
@+
OVEN
OVEN
[Idle]
[Idle]
R1
USER
??Button-Push??
R8
-
USER
??Door-Opened??
R1
@
BUTTON
[Pushed]
R8
-
DOOR
[Open]
R1
POWER-TUBE
[Energized]
R8
-
BUTTON
[Disabled]
R8
-
OVEN ^
[Open]
R1
1
@
OVEN
[Cooking]
R2
+
USER
??Button-Push??
R5
+
USER
??Door-Opened??
R2
BUTTON
[Pushed]
R5
@
DOOR
[Open]
R7
R2
OVEN
[Extra-Minute]
R5
+
POWER-TUBE
[Off]
R3
C
R2
+
OVEN ^
[Cooking]
R5
OVEN
[Cooking-Stopped]
Component
Behavior Projection
R1
R8
-
R6
OVEN
[Open]
R6
OVEN
[Idle]
OVEN
[Cooking]
R8
OVEN ^
[Open]
R2
OVEN
[Extra-Minute]
R5
OVEN
[Cooking-Stopped]
R7
OVEN
?? Timed-Out ??
R2
OVEN ^
[Cooking]
R5
-
OVEN ^
[ Open ]
R7
OVEN
[Cooking-Finished
R5
-
OVEN ^
[ Idle ]
LIGHT
[ On ]
M issing
R7
OVEN
?? Timed-Out ??
LIGHT
[Off]
R7
POWER-TUBE
[Off]
BUTTON
[Disabled ]
R7
BEEPER
[Sounded]
R7
OVEN
[Cooking-Finished
M issing
4. Discussion
In contrast to other methods that are used for objectoriented design the GSE method relies on the use of a
single notation, behavior trees, to represent (1) behavior in
individual functional requirements (or use-cases), (2) the
integrated behavior of a set of requirements and (3) the
projected behavior of individual components. Behavior
trees capture what is usually spread across sequence
diagrams, activity diagrams, class diagrams and statemachines. The initial focus in GSE is on translation,
integration of functional requirements and defect
detection. This contrasts with the strong focus on
identifying objects and classes in more traditional object
oriented design. It is important to note that the Behavior
Tree Notation which forms the backbone of the GSE
method can be formalised using an extension to Dijkstras
Weakest Precondition theory [8]. Our intention, in the
C
[s]
have:
Applying (2) for a component state X[s1], a postcondition X.t1 =
s1, and assuming s1 is defined we have:
wp ( X[s1] , X.t1 = s1 , t1 ) ) X.t1 = s1[s1 / X.t1]
( s1 = s1) TRUE
10
Conclusion
What we have presented is an intuitive, stepwise process
for going from a set of functional requirements to a
design. The method is attractive for its simplicity, its
traceability, its ability to detect defects, its control of
complexity, and its accommodation of change. However,
like any method, Genetic Software Engineering, will only
References
[1] G.Booch, J. Rumbaugh, I Jacobson, The Unified Modelling
Language User Guide, Addison-Wesley, Reading, Mass. (1999).
[2] A.M.Davis, A Comparison of Techniques for the
Specification of External System Behavior, Comm. ACM, vol.
31 (9), 1098-1115, (1988).
[3] D.Harel, Statecharts: Visual Formalism for Complex
Systems, Sci. Comp. Prog., 8, 231-274 (1987)
[4 ] D. Harel., W. Damm, LSCs: Breathing Life into Message
Sequence Charts, 3rs IFIP Conf. On Formal Methods for Open
Objected-based Distributed Systems, New York, 1999, Kluwer
[5] D. Jackson, Alloy: A Lightweight Object Modelling
Notation, MIT Lab. for Comp. Sci. Report (1999)
[6] A. Woolfson, Living Without Genes, Flamingo, (2000).
[7] S. Shlaer, S.J. Mellor, Object Lifecycles, Yourdon Press,
New Jersey, 1992.
[8] D. Gries, The Science of Programming, Springer-Verlag,
(1981).
[9] S.J. Prowell, C.J.Trammell, R.C. Linger, J.H. Poore,
Cleanroom Software Engineering: Technology and Process,
Addison-Wesley, Reading Mass., (1999).
11