# Software Engineering Requirements Engineering

Document Sample

```					Functional Modeling

081
Question
   How do you know if you have enough information to compute
the necessary output values?
Functional Models
   What is a function?
Steps in constructing Functional
Model
 Identify data (e.g. input and output values)
 Identify transformations (e.g., functions)
 Identify sources and sinks for data
 Draw Diagram
 Identify the constraints.
Data Flow Diagrams:
http://www.yourdon.com/strucanalysis/wiki/index.php?title=Chapter_9

   Four things in diagrams
 Processes   (ellipses)
 Data flows (arrows)

 Actors      (boxes)
 Data stores (“open boxes”, parallel lines)

Data store
Simple Example DFD
Compute       Student Names

Compute
Names

Output
Processes
 Transforms data values
 Drawn as ellipses with fixed number of in-
arrows and out-arrows
 Example:

dividend               quotient
Integer
division
remainder
divisor
Levels of detail
 Level 1: Shows system inputs, outputs, and
processes inputs              outputs
program
 Level 2: Shows inputs, outputs, and processes
for some Level 1 process
 Level 3: Shows inputs, outputs, and processes
for some Level 2 process
Data Flows
 Connect processes
 Represent intermediate data
 Values are not changed by data flow
 Arrow with name or type of data

city
zip
integer                      zip
street
copy      Aggregation
simple                                  Aggregation
split               join
Actors
 Producers or consumers of data
 aka “terminators”, “source and sink”
 Drawn as rectangle

Customer
Data Store
   Stores data for later use
   Has exactly two operations:
 Store

 Retrieve

   Not an actor: must have both store and retrieve
   Drawn as

Data store
Example
Initialize
table
Atomic
weights
Periodic Table
Atomic
weights             Atomic
element        Find           weight
weight
Example

Item name
Price List
Cost

Cost
Item name      Find
cost
Level 1
Employee
Records                Paychecks

Process
Payroll

TimeCards             Accounting
Report
Level 2: Payroll Process
Format
Employee                              paycheck
Formatted Paycheck.
Records
Paycheck Info
Emp. Info.
Paychecks
Calculate
Withholding         Acct. Inf.
Calculate
Gross Pay                               Format
GrossPay
Accounting

Valid Timecard Info                                          Formatted
Acct. Inf.
Validate
TimeCard                         Accounting
TimeCards                                                    Report
Timecard Info.
Level 2: Calculate Withholding

Emp. Info.

Compute
Withholding
Rate
Rate

Paycheck Info
Gross Pay
Compute
Net
Acct. Inf.
Notes:
   Show all possible computation paths for values.
   Do not show what paths are executed in what
order (that’s the job of the dynamic model).
   There may be many Level N+1 diagrams for each
Level N diagram. Level N+1 expands a single
node of a Level N diagram.
Things to check in DFDs
1.   Is each requirements function represented
by a transform in the DFDs?
2.   Is each system input and output
represented in the DFDs?
Things to check in DFDs (cont’d)
5.   Are all labels of information flows in the
data dictionary?
6.   Do all data dictionary entries appear in the
DFDs?
UML Activity Diagrams
 Capture Actions and their results
 Similar to state diagrams
 Actions and results show in terms of state
changes
 Transitions occur when actions are

complete (no events)
Purposes of Activity Diagrams
 Capture work (actions) to be performed
when an operation executes
 Capture the internal work in an object
 Show how related actions can be performed
 Show how an instance of a use case can be
performed in terms of actions and objects
 Show how a business works in terms of
actors, workflows, and objects
Activity Diagrams
   Actions
 Something performed to produce a result
 An operation may consist of a set of actions

 Drawn as rounded-edged rectangles
   Edges
 Do not have events (except for first edge)

 May have guard conditions, send-clause, or
action expression
 Usually have nothing (transition occurs when
action is complete)
Activity Diagram Elements

Show          Create
Customer.Print()   “Printing”       pdf
in           file
MessageBox

Send
Remove         pdf
MessageBox   to printer
Activity Diagram Elements

Show                  Create
Customer.Print()   “Printing”               pdf
in                   file
MessageBox

^Printer.Print(file)

Remove
MessageBox
Activity Diagram Elements
Show
<<decisionInput>>                               Disk Full msg
disk status         [full]

Customer.Print()

[free space]               1

Show
“Printing”                Create               ^Printer.Print(file)    Remove
1          in                     pdf                                        MessageBox
MessageBox                 file
Style Points
   Each edge leaving a decision point should have a
guard
   Guards on edges leaving decision points must not
overlap (deterministic)
   Guards on edges leaving decision points form a
complete set (must be possible to leave the guard)
 [otherwise] can be used as a fall through case

   Model guards only if they add value
   Simplify Guards (see following)
Three examples of guards
[account.balance >= withdraw.amount]

[account.balance < withdraw.amount]

<<decisionInput>>
[account.balance >= withdraw.amount]
[true]

[false]

Sufficient          [true]
Balance?

[false]
More style points
   Include start and end points
   Question “black hole” (no output edge) and
“miracle” (no input edge) activities
   Use connectors to avoid hard to follow edges, but
make sure they match
   Use numbers on connectors
Parallel Actions

Initiate

Update
Measure
Display
Using Objects to Represent
Datastore
Initiate

Measured     Update
Measure    value        Display
Specifying Operations in Greater
Detail
   Need a signature
 Name

 Arguments (number, order, types)

 Values returned (number, order, types)

   Need transformations
 Functions and equations

 Tables of values

 Pre and post conditions

 Decision tables

 Pseudo code

 Natural language
Operations
 Trivial
 Access: read or write attributes. May not

be necessary to show all of these.
 Non-trivial
 Queries: no side effects

 Actions: “instantaneous” (atomic)

 Activities: duration over time

```
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
 views: 4 posted: 9/8/2011 language: English pages: 32