Research Design Techniques
Research Design Techniques
1
Introduction
How do we specify what this system does?
How do we specify the software?
Why is this important?
To generate Software Requirements
Document and Design Document
Choosing an I/O Method
We will look at I/O methods of
specifying how a system should work
None of the following I/O methods is
the best for ALL situations
Use what is suited to the project
Use what makes sense to you
But be familiar with multiple methods
I/O Techniques
Natural Languages
Mathematical
Flowcharts
Structure Charts Finite State Automata
Pseudocode Dataflow Diagrams
PDL’s Petri Nets
Warnier-Orr Notation
State Charts
Natural Language
PIN Check
Transaction Type
Query
Withdrawl
Pseudocode & PDL’s
Example II-b
Withdrawal
Deposit
Illegal
Example of Good PDL
14
Pseudocode & PDL’s
Advantages
Close to programming language
leads itself to automatic code generation
Can model concurrency
if language supports it
Formal methods apply
similar to mathematical specs
Disadvantages
User must learn the programming language
More error-prone than more visual techniques
Finite State Automata
Automata --> Machines
Represents systems by a fixed # of
states
System changes states based on
certain events
Three ways of representation
Set theoretical (i.e. using set theory)
Diagrammatic - State Diagram
Matrix Representation - State Transition
Table
Finite State Automata
Moore VS Mealy
Moore:
Outputs are a function of the current state
only
Mealy
Outputs are a function of both the current
state and the inputs
State Diagram
Each state is a “Bubble” w/ state names
Each bubble must show the next state for
every possible input condition
Finite State Automata
Example - Moore Machine
Finite State Automata
Example - Moore Machine Table
Finite State Automata
Example - Mealy Machine
Finite State Automata
Example - Mealy Machine Table
Finite State Automata
Example - Mealy Machine for ATM
Finite State Automata
Example - Mealy Machine - Transition Table
Finite State Automata
Advantages
Widely used
Fairly Easy
Structured
Auto code generation possible if enough detail
Can optimize code with standard state
machine reduction techniques
Disadvantages
Can’t see what’s inside of the states
Difficult to show concurrent processes and
their communication (each process is a FSM)
Data Flow Diagrams
Shows major functions of systems
Shows how data flows between them
Shows concurrency between processes as
well as dependencies between processes
Data Flow Diagrams
DeMarco’s Rules
Advantages
Widely used
Show concurrency
May be helpful in partitioning systems
Disadvantages
Must be used w/ other methods for RT systems
Difficult to show signaling/synch between
processes
Petri Nets
Mathematical Model (Precise)
Also, a graphical model
Good for multitasking representations
Similar to dataflow, except this shows
states.
Petri Nets
Example I
Petri Nets
Example I - Firing Table
Petri Nets
Terminology
Circles
“Places” (Data stores or processes)
Marked as P1, P2…
Places are marked with the number of data
items they contain at each point in time
Graph structure doesn’t change
Markings change as data flows through
system
Each marking of the graph is a snapshot of
the system in time (state)
Petri Nets
Terminology
Rectangles
Represent transitions or operations
Labeled w/ mathematical transition function
Firing
Transition of system from one state to
another
Firing Table
Matrix showing the marking of the system
for each state
Petri Nets
Example II
Petri Nets
Example III - Sequence
Petri Nets
Example III - Conditional Branch
Petri Nets
Example III - While Loop
Petri Nets
Example IV
Petri Nets
Example IV
Petri Nets
Example IV
Petri Nets
Advantages
Mathematical lends itself to optimization
& formal methods
Good visual picture (similar to
flowcharts)
Shows concurrency & inter-process
communication
even shows when a process is waiting on
another
Petri Nets
Disadvantages
Overkill if used on simple systems
Timing can be obscure for highly
complex systems
Petri Nets
Example V
Petri Nets
Example V
Warnier-Orr Notation
Similar to structure charts with several
improvements
Can be used to show both data structures &
processes
Structure charts just used for processes
Uses more rigorous “Set Theory” notation
Left --> Right - Increasing Detail
Top --> Bottom - Order of execution
Warnier-Orr Notation
Example I
Accept
Coins
Dispense
Accept Coins Cup Cream
Dispense Cream?
Coffee Coffee Sugar
Sugar?
Choice? Decaf Dispense Cream? Cream
Decaf Sugar? Sugar
Tea Dispense Cream? Cream
Tea Sugar? Sugar
Warnier-Orr Notation
Can also show conditionals & branching
Not possible w/ structure charts
If-Then
label { condition? { steps
If-Then-Else
label { condition { true action
{ condition false { false action
Warnier-Orr Notation
While
label (condition, W) { statement
Repeat Until
label (condition, U) { statement
Warnier-Orr Notation
Example II - Indexed Loop
Warnier-Orr Notation
Example III - ATM
Warnier-Orr Notation
Example IV - High-Level Data Structure
Warnier-Orr Notation
Pros & Cons
Advantages
Structure charts plus branching & ability to
model data structures
Disadvantages
Diagrams can get very large & complex
Synch of concurrent processes using only
conditionals is restrictive
Not well known or widely used
State Chart
Combine FSM w/ dataflow diagrams
Has broadcast communication feature
communication between separate processes
Can show concurrent processes
orthogonal processes
Can show increasing levels of detail
depth
State Chart
Basic Method
FSM
Label states w/ capital letters (or phrases)
Depth
Represented by putting states inside of
states
Orthogonality
Independent, concurrent Processes
Represented by dashed lines btwn states
State Chart
Basic Method
State Transitions
Use symbols a, b, …z to represent Events that
trigger transitions
Small letters in parentheses to show conditions for
transitions
Broadcast Communications
A method of allowing multiple orthogonal
processes to react to the same event
Shown by labeled arrows
State Chart
Example I - Broadcast Comm. - Chain Reaction
State Chart
Example II
State Chart
Example II
State Chart
Example III