Process Description

advertisement
System Analysis And Design
8. PROCESS
DESCRIPTION
Program: BSCS II (Advent Semester – 2014)
Lecturer: Rebecca Asiimwe
Email: rasiimwe@technology.ucu.ac.ug1
Process DescriptionLogic Modeling
• Data flow diagrams do not show the logic inside
the processes
• In our previous lecture, we noted processes such
as Verify Order, Compute Marks, Validate
Application, but we did not explain the logic
necessary to execute these tasks. The methods
available for documenting and analyzing the logic
of decisions include structured English, decision
tables, and decision trees.
• Logic modeling can also be used to show when
processes on a DFD occur.
2
Goals of Process Description
1. To reduce the ambiguity of the process. This goal
compels the analyst to learn details about how the process
works. Any vague areas should be noted, written down,
and consolidated for all process specifications. These
observations form a basis and provide the questions for
follow-up interviews with the user community.
2. 2. To obtain a precise description of what is
accomplished.
3. To validate the system design. This goal includes
ensuring that a process has all the input data flow
necessary for producing the output. In addition, all input
and output must be represented on the data flow diagram.
3
Goals of Process Description
• Note: you will find many situations in which
process specifications are not created/required.
• Sometimes the process is very straight forward
and simple. A process such as “Receive
Applications” may not need further description
while a process such as “Choose Winner” may
prompt an analyst to further probe this process
for details - how is a winner chosen (what
conditions are looked at)?
4
Process Description
– Process Description may be achieved
using;
• Structured English
• Decision tables
• Decision Trees
– These are the commonly used techniques
6
Structured English
• It is a way of describing the flow of a process
• Structured English is a modified form of English used
to specify the logic of information processes.
• Used when the process logic involves formulas or
iterations, or when structured decisions are not
complex.
• A process will follow sequentially but at times a
selection needs to be made or a repetition condition
is required.
– Uses Instructions, repetitions and if-then-else logic
– Note that this is not necessarily a computer program (its
7
an algorithm that describes the process)
From user-speak to programming
Plain
English
Structured
English
User
Analyst
Pseudo code
Programs
Programmer
8
Modeling Logic with Structured
English
• Uses a subset of English
– Action verbs
– Noun phrases
– It should read like English
• No specific standards exist
9
Structured English
•
•
•
•
Well suited for many process descriptions
A series of informal English statements
Uses a small selected vocabulary
Provides effective communication between
users and programmers
• Users are generally more comfortable with
these English statements
• Sufficiently precise to avoid
misinterpretation
10
Structured English - Style
• Keep statements brief
• Use and capitalize accepted keywords such as IF,
THEN, ELSE, DO, DO WHILE, DO UNTIL, and
PERFORM.
• Use small group of words –avoid being verbose
• Indent blocks of statements to show their
hierarchy (nesting) clearly.
• Use strong, action- oriented verb with an object
e.g. compute, print, copy, update, validate
• Structured English should NOT be as rigorous as11
a programming language.
Example
Process: Check Patient Status
Process Description
IF Patient is a new patient
THEN Perform Add new patient Process
ELSE
IF patient has unpaid bills
THEN transfer the patient to the business office
12
• Represent the logic in this table as
Structured English
13
Structure English Representation
IF employee type is Salary
THEN pay base salary
ELSE
IF employee type is Hourly AND works for <40 hours
THEN calculate hourly wage and absence Report
ENDIF
IF employee type is Hourly AND works for 40 hours
THEN calculate hourly wage
ENDIF
IF……
14
Limitation of Structured English
– Not so good for showing complex
decision logic
– Not so good if there are few or no
sequential steps
15
Decision Trees
• A decision tree is a graphical description of process
logic that uses lines organized like branches of a tree.
• They are helpful where there is a large number of
nested IF statements
• Decision Trees use a circle to represent a condition
point and a square node to indicate an action (outcome
branches like branches of a trees )
• Using notation makes the decision tree more readable,
as does numbering the circles and squares
sequentially. Think of a circle as signifying IF, whereas
the square means THEN.
16
• Easy to construct and understand
Decision Tree Diagram
• Illustration of Decision Tree
17
Constructing a Decision Tree
• Identify all decision variables, and the possible
values for each variable
• Generate the tree systematically (left to right)
– Draw one branch from the root for each value of the
first decision variable- label each branch
– The right end of each branch is a decision point
– At each decision point, draw one branch for each
value of the next decision variable - label each
branch
– Repeat until no more decisions.
19
Constructing a Decision Tree
(Cont)
• Identify the independent actions, and label
each leaf with the action (s) to be taken
• Formulate questions for users to resolve
omissions and ambiguities etc.
• Revise and complete the decision tree.
20
Example
21
Decision Tree Example
A point-of-sale example was used to determine
the purchase approval actions for a department
store.
Conditions included the amount of the sale
(under $50) and whether the customer paid by
check or credit card.
The four actions possible were to ring up the
sale, look up the credit card in a book, call the
supervisor for approval, or call the bank for credit
card authorization.
22
Decision Tree Example
23
Decision Table
• Is a matrix representation of the logic of a decision.
• Specifies the possible conditions and the resulting
actions
• It’s best used for complicated decision logic
• Show a logical structure that describe a process
logic
• Every logical combination is shown initially
• Results then can be combined and simplified
• Programmers can use decision tables in
24
developing code
Decision Tables (Cont)
• Consists of three major parts:
• Condition stubs-lists conditions relevant to
decision. Describes the conditions or factors that
will affect the decision
• Action stubs- lists actions that result from a
given set of conditions. Describe the possible
policy actions or decisions
• Rules- specify which actions are to be taken for
a given set of conditions
25
Decision Tables
• A decision table is a table of rows and
columns, separated by four quadrants.
CONDITIONS AND
ACTIONS
Conditions
Actions
RULES
Conditions
alternatives
Action entries
• Programmers can use decision tables in
developing code
26
Decision Table Diagram
Condition
List (statement)
Condition
Matrix (entries)
Action
List (statements)
Action
Matrix (entries)
27
Decision Table for Payroll System
Example
28
Steps to Construct a Decision
Table
1.
2.
3.
4.
5.
6.
7.
Identify conditions & values
Compute maximum number of Rules
Identify possible actions
Enter all Possible Rules
Define Actions for each rule
Verify the policy
Simplify the table
29
ExampleRefer to appended notes
• Scenario: A marketing company wishes to construct
a decision table to decide how to treat clients
according to three characteristics: Gender (M or F),
City resident (Y or N), and age group: A (under 30),
B (between 30 and 60), C (over 60).
• The company has four products (W, X, Y and Z) to
test in the market. Product W will appeal to female
city residents. Product X will appeal to young
females (under 30). Product Y will appeal to Male
middle aged shoppers who do not live in cities.
Product Z will appeal to all but not to older females.
Interpret this Decision Table
31
Decision Tables
• Advantages of Decision Tables
– It’s concise, unambiguous, clearly conveying the logic
involved, hence less danger of omitting a logical possibility
– Enhanced communication with action separated from
conditions
– Easier to draw and they’re easily understood.
– Produces an automatic compact program documentation.
– Its’ format is highly standardized
– Can be checked mathematically for completeness and that
all test combinations have been considered.
• Disadvantages of Decision Tables
– However they do not show the sequence of decisions
32
Decision Table or
Decision Tree?
• Major advantages of Decision Table is the
guaranteed consideration of ALL
combinations of conditions and their
resultant actions.
• Most users prefer the graphic nature of a
decision tree.
• Which of the two should be used?
33
Guidelines for using a Decision
Table or a Decision Tree
• Use a Decision Table when there are many
decision variables
• Use a Decision Table when decision rules
require combination of actions
• Use a Decision Tree when there are few
decision variables and only one action per
rule.
• Use a Decision Table as a working tool when
need to check all combinations of conditions
– Present the policy as a decision tree, if it
satisfies the above.
34
More:
1. Use structured English when
a. There are many repetitious actions, OR
b. Communication to end users is important.
2. Use decision tables when
a. Complex combinations of conditions, actions, and rules
are found, OR
b. You require a method that effectively avoids impossible
situations, redundancies, and contradictions.
3. Use decision trees when
a. The sequence of conditions and actions is critical, OR
b. When not every condition is relevant to every action (the
35
branches are different).
Q&A
36
Download