Page 115 -
P. 115
98 Chapter 4 Requirements engineering
Condition Action
Sugar level falling (r2 r1) CompDose 0
Sugar level stable (r2 r1) CompDose 0
Sugar level increasing and rate of increase CompDose 0
decreasing ((r2 r1) (r1 r0))
Sugar level increasing and rate of increase stable or CompDose round ((r2 r1)/4)
increasing ((r2 r1) (r1 r0)) If rounded result 0 then
CompDose MinimumDose
When a standard form is used for specifying functional requirements, the follow-
Figure 4.11 Tabular
specification of ing information should be included:
computation for
an insulin pump 1. A description of the function or entity being specified.
2. A description of its inputs and where these come from.
3. A description of its outputs and where these go to.
4. Information about the information that is needed for the computation or other
entities in the system that are used (the ‘requires’ part).
5. A description of the action to be taken.
6. If a functional approach is used, a pre-condition setting out what must be true
before the function is called, and a post-condition specifying what is true after
the function is called.
7. A description of the side effects (if any) of the operation.
Using structured specifications removes some of the problems of natural lan-
guage specification. Variability in the specification is reduced and requirements are
organized more effectively. However, it is still sometimes difficult to write require-
ments in a clear and unambiguous way, particularly when complex computations
(e.g., how to calculate the insulin dose) are to be specified.
To address this problem, you can add extra information to natural language
requirements, for example, by using tables or graphical models of the system. These
can show how computations proceed, how the system state changes, how users inter-
act with the system, and how sequences of actions are performed.
Tables are particularly useful when there are a number of possible alternative sit-
uations and you need to describe the actions to be taken for each of these. The insulin
pump bases its computations of the insulin requirement on the rate of change of
blood sugar levels. The rates of change are computed using the current and previous
readings. Figure 4.11 is a tabular description of how the rate of change of blood
sugar is used to calculate the amount of insulin to be delivered.