12
Seg3430A Tutorial 8 Decision Table

Seg3430A Tutorial 8 Decision Table. Logic Modeling Data flow diagrams do not show the logic inside the processes Logic modeling involves representing

Embed Size (px)

DESCRIPTION

Modeling Logic with Decision Tables Decision Table –A matrix representation of the logic of the decision –Specifies the possible conditions and the resulting actions. –Best used for complicated decision logic Consists of three parts –Condition stubs: lists the conditions to the decision –Action stubs: lists the actions that result for a given set of conditions –Rules: specifies which actions are to be followed for a given set of conditions

Citation preview

Page 1: Seg3430A Tutorial 8 Decision Table. Logic Modeling Data flow diagrams do not show the logic inside the processes Logic modeling involves representing

Seg3430A Tutorial 8

Decision Table

Page 2: Seg3430A Tutorial 8 Decision Table. Logic Modeling Data flow diagrams do not show the logic inside the processes Logic modeling involves representing

Logic Modeling

• Data flow diagrams do not show the logic inside the processes

• Logic modeling involves representing internal structure and functionality of processes depicted on a DFD

• Logic modeling can also be used to show when processes on a DFD occur

• For example, Structured English, Decision Tables, Decision Trees, State-transition diagrams, Sequence diagrams, Activity diagrams

Page 3: Seg3430A Tutorial 8 Decision Table. Logic Modeling Data flow diagrams do not show the logic inside the processes Logic modeling involves representing

Modeling Logic with Decision Tables

• Decision Table– A matrix representation of the logic of the decision– Specifies the possible conditions and the resulting

actions.– Best used for complicated decision logic

• Consists of three parts– Condition stubs: lists the conditions to the decision– Action stubs: lists the actions that result for a given set

of conditions– Rules: specifies which actions are to be followed for a

given set of conditions

Page 4: Seg3430A Tutorial 8 Decision Table. Logic Modeling Data flow diagrams do not show the logic inside the processes Logic modeling involves representing

Decision Table Methodology• Step 1: Identify conditions and values

– Find condition tests and all of the values• Step 2: Compute Max Number of Rules

– Multiply the number of values for each condition• Step 3: Identify possible actions

– Determine independent actions to be taken• Step 4: Enter all possible rules

– Fill in the values of the conditions in each numbered rule column• Step 5: Define actions for each Rule

– Mark the appropriate actions with X• Step 6: Verify the policy

– Review the decision table with end-users• Step 7: Simplify the table

– Eliminate and/or consolidate rules

Page 5: Seg3430A Tutorial 8 Decision Table. Logic Modeling Data flow diagrams do not show the logic inside the processes Logic modeling involves representing

An Example

• Scenario:– A marketing company wishes to construct a decision

table to decide how to treat clients according to three characteristics: Gender, City Dweller, 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 market. Product W will appeal to female city dwellers. Product X will appeal to young females. Product Y will appeal to Male middle aged shoppers who do not live in cities. Product Z will appeal to all but not the older females.

Page 6: Seg3430A Tutorial 8 Decision Table. Logic Modeling Data flow diagrams do not show the logic inside the processes Logic modeling involves representing

An Example• Step 1: Three conditions &values:

– Gender F/M– City Y/N– Age group A/B/C

• Step 2:– Max. num. of rules = 2x2x3 = 12

• Step 3: Five actions– Market product W– Market product X– Market product Y– Market product Z– Do not market product

Page 7: Seg3430A Tutorial 8 Decision Table. Logic Modeling Data flow diagrams do not show the logic inside the processes Logic modeling involves representing

An Example• Step 4 & Step 5: :

Conditions 1 2 3 4 5 6 7 8 9 10 11 12

Gender F M F M F M F M F M F M

City Y Y N N Y Y N N Y Y N N

Age group A A A A B B B B C C C C

ActionsMarket W X X XMarket X X XMarket Y XMarket Z X X X X X X X X X XDon’t market

X

Page 8: Seg3430A Tutorial 8 Decision Table. Logic Modeling Data flow diagrams do not show the logic inside the processes Logic modeling involves representing

Simplify Decision Table• Remove impossible rules• Eliminate indifferent conditions

– An indifferent condition is a condition whose values do not affect the decision and always result in the same action.

– These rules can be consolidated into a single rule

• Simplify unclear rules or actions

Page 9: Seg3430A Tutorial 8 Decision Table. Logic Modeling Data flow diagrams do not show the logic inside the processes Logic modeling involves representing

An Example1 2 3 4 5 6 7 8

Condition-1 Y Y Y Y N N N NCondition-2 Y Y N N Y Y N NCondition-3 Y N Y N Y N Y N

Action-1 XAction-2 XAction-3 X X XImpossible X X X

Page 10: Seg3430A Tutorial 8 Decision Table. Logic Modeling Data flow diagrams do not show the logic inside the processes Logic modeling involves representing

An Example• Eliminate impossible rules

1 2 3 4 5Condition-1 Y N N N NCondition-2 Y Y Y N NCondition-3 Y Y N Y N

Action-1 XAction-2 XAction-3 X X X

Page 11: Seg3430A Tutorial 8 Decision Table. Logic Modeling Data flow diagrams do not show the logic inside the processes Logic modeling involves representing

An Example• Merge rule 4 and 5 to form 4’

1 2 3 4’Condition-1 Y N N NCondition-2 Y Y Y NCondition-3 Y Y N -

Action-1 XAction-2 XAction-3 X X

Page 12: Seg3430A Tutorial 8 Decision Table. Logic Modeling Data flow diagrams do not show the logic inside the processes Logic modeling involves representing

An Example• Simplify unclear rules

1’ 2 3 4’Condition-1 Y N N NCondition-2 - Y Y NCondition-3 - Y N -

Action-1 XAction-2 XAction-3 X X