Decision Table and Decision Tree

Decision Table

decision table shows the decision making logic and the corresponding actions taken in a tabular or a matrix form. The upper rows of the table specify the variables or conditions to be evaluated and the lower rows specify the actions to be taken when an evaluation test is satisfied. A column in the table says a rule. A rule implies that if a certain condition combination is true, then the corresponding action executed.

Example 1

Consider an example of Library Management System(LMS)

Conditions

Rule 1

Rule 2

Rule 3

Rule 4

Valid Selection

NO

YES

YES

YES

New member

-

YES

NO

NO

Renewal

-

NO

YES

NO

Cancellation

-

NO

NO

YES

Actions

Display error message(E)

E

 

 

 

Ask Member’s name, dept,etc

 

ü

 

 

Build record

 

ü

 

 

Generate bill

 

ü

ü

 

Ask Membership details

 

 

ü

ü

Update expiry date

 

 

ü

 

Print cheque

 

 

 

ü

Delete record

 

 

 

ü


Example 2

To create the decision table for a login screen that asks for UserId and Password.

Conditions

Rule 1

Rule 2

Rule 3

Rule 4

UserId

FALSE

TRUE

FALSE

TRUE

Password

FALSE

FALSE

TRUE

TRUE

Actions

Error message is displayed(E)

E

E

E

-

Home screen is displayed(H)

-

-

 

H


Example 3
There is a dialogue box that will ask the user to upload a photo with the following conditions:
  • The file must be in the .jpg format.
  • The file size must be less than 32kb.
  • The image resolution must be 137*177.
If any one of the above conditions fails, the system will display the corresponding error messages about the issue. If all conditions are satisfied, the photo will be uploaded successfully. 

Conditions

Rule 1

Rule 2

Rule 3

Rule 4

Rule 5

Rule 6

Rule 7

Rule 8

Format

.JPG

.JPG

.JPG

.JPG

NOT .JPG

NOT .JPG

NOT .JPG

NOT .JPG

Size

< 32  KB

< 32 KB

>= 32KB

>= 32KB

< 32 KB

< 32 KB

>=

32KB

>= 32KB

Resolution

137 * 177

NOT

137 * 177

137

*

177

NOT

137

*

177

137 * 177

NOT

137 * 177

137

*

177

NOT

137

*

177

Actions

 

 

 

 

Error message due to format, size and resolution mismatch

 

 

 

 

 

 

 

ü

Error message due to format and size mismatch

 

 

 

 

 

 

ü

 

Error message due to format and resolution mismatch

 

 

 

 

 

ü

 

 

Error message due to format mismatch

 

 

 

 

ü

 

 

 

Error message due to size and resolution mismatch

 

 

 

ü

 

 

 

 

Error message due to size mismatch

 

 

ü

 

 

 

 

 

Error message due to resolution mismatch

 

ü

 

 

 

 

 

 

Photo uploaded successfully

ü

 

 

 

 

 

 

 



Decision Tree
decision tree gives a graphic view of the processing logic involved in decision making and the corresponding actions taken. Decision tables specify which variables are to be tested, and based on this what actions are to be taken depending upon the outcome of the decision making logic, and the order in which decision making is performed. The edges of a decision tree represent conditions and the leaf nodes represent the actions to be performed depending on the outcome of testing the conditions.
Decision tree (LMS)

Decision tree ( Login Screen)




No comments:

Post a Comment