SlideShare a Scribd company logo
DecisionTable
A decisiontable isagraphical methodforexplainingthe logicof makingdecisionintabularformat.
It isa setof conditions+setof actionsand differentcombinationsof decisions.
“It isa matrix representationof logicof decisions whichspecifythe possible conditionsfordecisionand
resultingactions.”
The decisiontable isdividedintotwoparts:
1. Condition
2. Action
1. Condition:
The conditionpartspecifiesall conditionsthatare appliedtothe inputteddata.Itis alsodividedinto
twoparts à
i. ConditionStub:-
It describesthe conditionsthatexistinthe programlogic.
ii. Condition Entry:-
It providesanswerstoquestionsaskedinthe conditionaskedinthe conditionterm.
2. Action:
The action part issubdividedintotwoparts à
i. ActionStub:-
It describesthe actiontobe takento meeteachcondition.
ii. ActionEntry:-
It describesthe appropriate actionresultingfromthe answertothe conditioninconditionentry.
Format:
Table Heading DecisionRule
ConditionStub ConditionEntry
ActionStub ActionEntry
Advantages of DecisionTable
1. It providescompactrepresentationof decisionmakingprocess.
2. It is easiertounderstandparticularpath.
3. It can be changedaccordingto situation.
4. These are bestsuitedforcalculatingdiscounts,commissionsorinventorycontrol procedures.
5. The structure of decisiontable promotesalogicallycomplete andconsistentproblemdefinition.
Disadvantages of DecisionTable
1. It cannot expressthe completesequence of operationstosolve aproblemtherefore itmaybe
difficultforthe programmertotranslate decisiontable intoprogram.
2. If there are too manyalternatives,itisdifficulttolistindecisiontable.
3. It doesnot showthe flowof logicfor the solutiontoa givenproblem.
Let's create a decision table for a login screen.
The conditionissimple if the userprovidescorrectusername andpasswordthe userwill be redirected
to the homepage.If anyof the inputiswrong,an errormessage will be displayed.
Conditions Rule 1 Rule 2 Rule 3 Rule 4
Username (T/F) F T F T
Password (T/F) F F T T
Output (E/H) E E E H
Legend:
 T – Correct username/password
 F – Wrong username/password
 E – Error message isdisplayed
 H – Home screenisdisplayed
Interpretation:
 Case 1 – Username andpasswordbothwere wrong.The useris shownanerror message.
 Case 2 – Username wascorrect,but the passwordwaswrong.The useris shownanerror
message.
 Case 3 – Username waswrong,but the passwordwascorrect.The useris shownanerror
message.
 Case 4 – Username andpasswordbothwere correct,and the usernavigatedtohomepage
While convertingthistotestcase,we can create 2 scenarios,
 Enter correctusername andcorrect password andclick onlogin,andthe expectedresultwill be
the usershouldbe navigatedtohomepage
Andone from the belowscenario
 Enter wrongusername andwrongpasswordandclickon login,andthe expectedresultwill be
the usershouldgetan error message
 Enter correctusername andwrongpasswordand clickon login,andthe expectedresultwillbe
the usershouldgetan error message
 Enter wrongusername andcorrectpasswordand clickon login,andthe expectedresultwillbe
the usershouldgetan error message
As theyessentiallytestthe same rule.
Example 2: How to make DecisionTable for Upload Screen
Nowconsidera dialogue box whichwill askthe usertouploadphotowithcertainconditionslike –
1. You can uploadonly'.jpg'formatimage
2. file size lessthan32kb
3. resolution137*177.
If any of the conditionsfailsthe systemwillthrow correspondingerrormessage statingthe issue andif
all conditionsare metphotowill be updatedsuccessfully
Let's create the decisiontable forthiscase.
Conditions Case 1 Case 2 Case 3 Case 4 Case 5 Case 6 Case 7 Case 8
Format .jpg .jpg .jpg .jpg Not.jpg Not.jpg Not.jpg Not.jpg
Size Lessthan
32kb
Lessthan
32kb
>= 32kb >= 32kb Lessthan
32kb
Lessthan
32kb
>= 32kb >= 32kb
resolution 137*177 Not
137*177
137*177 Not
137*177
137*177 Not
137*177
137*177 Not
137*177
Output Photo
uploaded
Error
message
resolution
mismatch
Error
message
size
mismatch
Error
message
size and
resolution
mismatch
Error
message
for format
mismatch
Error
message
formatand
resolution
mismatch
Error
message
for format
and size
mismatch
Error
message
for format,
size,and
resolution
mismatch
For thiscondition,we cancreate 8 differenttestcasesandensure completecoverage basedonthe
above table.
1. Uploada photowithformat'.jpg', size lessthan32kb and resolution137*177 and clickon
upload.ExpectedresultisPhotoshoulduploadsuccessfully
2. Uploada photowithformat'.jpg',size lessthan32kb and resolutionnot137*177 and clickon
upload.ExpectedresultisError message resolutionmismatchshouldbe displayed
3. Uploada photowithformat'.jpg',size more than 32kb and resolution137*177 and clickon
upload.ExpectedresultisError message size mismatchshouldbe displayed
4. Uploada photowithformat'.jpg',size more than equal to32kb andresolutionnot137*177 and
clickon upload.ExpectedresultisError message size andresolutionmismatchshouldbe
displayed
5. Uploada photowithformatotherthan '.jpg',size lessthan32kb and resolution137*177 and
clickon upload.ExpectedresultisError message forformatmismatchshouldbe displayed
6. Uploada photowithformatotherthan '.jpg',size lessthan32kb and resolutionnot137*177
and clickon upload.ExpectedresultisErrormessage formatand resolutionmismatchshould be
displayed
7. Uploada photowithformatotherthan '.jpg',size more than32kb and resolution137*177 and
clickon upload.ExpectedresultisError message forformatandsize mismatchshouldbe
displayed
8. Uploada photowithformatotherthan '.jpg',size more than32kb and resolutionnot137*177
and clickon upload.ExpectedresultisErrormessage forformat,size andresolutionmismatch
shouldbe displayed
Q: An insurance companyusesthe followingrule todeterminethe eligibilityof adriverforinsurance.
The driverwill be insuredif:-
1. The driverlivesinthe citywithpopulationlessthan5000 andhe ismarriedman.
2. The driverlivesinthe citywithpopulationlessthan5000 andhe ismarriedand age is over30 years
old.
3. The driverlivesinthe citywithpopulationis5000 or more and it ismarriedfemale.
4. The driverismale over30.
5. The driverismarriedandunder30.
Condition Rule1 Rule2 Rule3 Rule4 Rule5 Else
Livesincity
population<5000
Y Y N - - -
Male Y - N Y - -
Married Y Y Y - Y -
Q: Studyfollowingconditionsanddrawa decisiontable:-
1. If productcode=A
Andcustomertype=1
Andthe order amount<=700
Then5% discountallowed
2. If productcode=A
Andcustomertype=2
Andthe order amount<=700
Then7.5% discountallowed
3. If productcode=A
Andcustomertype=1
Andthe order amount>=700
Then7.5% discountallowed
4. If productcode=A
Andcustomertype=2
Age>30 - Y - Y N -
Action Rule1 Rule2 Rule3 Rule4 Rule5 Else
Insured Y Y Y Y Y
Uninsured Y
Andthe order amount>700
Then10% discountallowed
5. A flatdiscountof 5% onproduct code=Bregardlessof customertype andthe orderamount
Q: Draw a decision
table fora company
withthree person
A,B,Cwhose share inthe companyare 50%,20%,30% sequentially.Anylow arisesinthe companywill be
passedif itis supportedbyshare holdersandwhose share holdingexceed2/3of the total shares.
Condition Rule1 Rule2 Else
A 50% Y Y -
B 20% N Y -
C 30% Y N -
Action Rule1 Rule2 Else
Low Passed Y Y
Condition Rule1 Rule2 Rule3 Rule4 Rule5 Else
Product
code=A
Y Y Y Y N -
Customer
type=1
Y N Y N - -
Order
amount<=700
Y Y N N - -
Action Rule1 Rule2 Rule3 Rule4 Rule5 Else
Discount5% Y Y
Discount
7.5%
Y Y
Discount10% Y
No Discount Y
Low Rejected N
Q: A Co-operatingbankxyzgrantedloanunderfollowingconditionsdraw decisiontableandtree-
1. If a customerhas a account withthe bankand has no loanoutstanding(nodues),loanwill be
granted.
2. If a customerhas an account isoutstandingfrompreviousloan,loanwill be grantedif special
managementapproval isobtained.
3. Rejectloanapplicationinall othercases.
Condition Rule1 Rule2 Else
CustomerhasAccount Y Y -
No Out-standingloan amount Y N -
Special ManagementApproval - Y -
Action Rule1 Rule2 Else
Loan ApplicationAccept Y Y
Loan ApplicationReject

More Related Content

PPTX
Helpdesk
DOCX
UNIT II - DECISION THEORY - QTBD - I MBA - I SEM
PDF
CreditRisk+ Model Tutorial 3.0
PPT
Decision Making
PDF
Detection of credit card fraud
PDF
Evaluation of transport safety policies in commercial motorcycle operation in...
DOCX
Applications of Rationalizability and Iterated DominanceEcon 4.docx
DOCX
Applications of Rationalizability and Iterated DominanceEcon 4.docx
Helpdesk
UNIT II - DECISION THEORY - QTBD - I MBA - I SEM
CreditRisk+ Model Tutorial 3.0
Decision Making
Detection of credit card fraud
Evaluation of transport safety policies in commercial motorcycle operation in...
Applications of Rationalizability and Iterated DominanceEcon 4.docx
Applications of Rationalizability and Iterated DominanceEcon 4.docx

Similar to Decision tables (20)

PDF
CREDIT CARD FRAUD DETECTION USING PREDICTIVE MODELLING
DOCX
AssumptionsAssumptionsPlant Capacity (megawatts)80Variable cost pe.docx
PPTX
Romanov moscow-boston-22.03, Business rules for profit incresing in mobile co...
PPTX
Decisiontree&amp;game theory
DOCX
Neural Network Model
PPTX
Mobile company services fitting to customer consumtion profile-spring sim2011...
PPTX
Romanov moscow-spring sim2011-finished
PDF
PPTX
OPERATIONS RCH-2.JKJKJKJKJKJKJKJKJKJKJKJKJKpptx
DOCX
ChapterTool KitChapter 1212912Corporate Valuation and Financial .docx
PPTX
Decision analysis
PPTX
Decision analysis
PPTX
Decision analysis
PPTX
Decision analysis
PPTX
Decision analysis
PPTX
Decision analysis
DOC
Ame configuration process end to end
DOCX
6 Final Assignment of ME (2).docx
PPTX
Decision theory
PPT
Incident Management
CREDIT CARD FRAUD DETECTION USING PREDICTIVE MODELLING
AssumptionsAssumptionsPlant Capacity (megawatts)80Variable cost pe.docx
Romanov moscow-boston-22.03, Business rules for profit incresing in mobile co...
Decisiontree&amp;game theory
Neural Network Model
Mobile company services fitting to customer consumtion profile-spring sim2011...
Romanov moscow-spring sim2011-finished
OPERATIONS RCH-2.JKJKJKJKJKJKJKJKJKJKJKJKJKpptx
ChapterTool KitChapter 1212912Corporate Valuation and Financial .docx
Decision analysis
Decision analysis
Decision analysis
Decision analysis
Decision analysis
Decision analysis
Ame configuration process end to end
6 Final Assignment of ME (2).docx
Decision theory
Incident Management
Ad

Recently uploaded (20)

PPTX
communication and presentation skills 01
PDF
III.4.1.2_The_Space_Environment.p pdffdf
PPTX
Artificial Intelligence
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
Fundamentals of Mechanical Engineering.pptx
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
PPT
A5_DistSysCh1.ppt_INTRODUCTION TO DISTRIBUTED SYSTEMS
PDF
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPT
introduction to datamining and warehousing
PDF
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
PPT
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
PPTX
introduction to high performance computing
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
Analyzing Impact of Pakistan Economic Corridor on Import and Export in Pakist...
PDF
737-MAX_SRG.pdf student reference guides
communication and presentation skills 01
III.4.1.2_The_Space_Environment.p pdffdf
Artificial Intelligence
UNIT 4 Total Quality Management .pptx
Fundamentals of Mechanical Engineering.pptx
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
A5_DistSysCh1.ppt_INTRODUCTION TO DISTRIBUTED SYSTEMS
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
introduction to datamining and warehousing
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
introduction to high performance computing
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Analyzing Impact of Pakistan Economic Corridor on Import and Export in Pakist...
737-MAX_SRG.pdf student reference guides
Ad

Decision tables

  • 1. DecisionTable A decisiontable isagraphical methodforexplainingthe logicof makingdecisionintabularformat. It isa setof conditions+setof actionsand differentcombinationsof decisions. “It isa matrix representationof logicof decisions whichspecifythe possible conditionsfordecisionand resultingactions.” The decisiontable isdividedintotwoparts: 1. Condition 2. Action 1. Condition: The conditionpartspecifiesall conditionsthatare appliedtothe inputteddata.Itis alsodividedinto twoparts à i. ConditionStub:- It describesthe conditionsthatexistinthe programlogic. ii. Condition Entry:- It providesanswerstoquestionsaskedinthe conditionaskedinthe conditionterm. 2. Action: The action part issubdividedintotwoparts à i. ActionStub:- It describesthe actiontobe takento meeteachcondition. ii. ActionEntry:- It describesthe appropriate actionresultingfromthe answertothe conditioninconditionentry. Format:
  • 2. Table Heading DecisionRule ConditionStub ConditionEntry ActionStub ActionEntry Advantages of DecisionTable 1. It providescompactrepresentationof decisionmakingprocess. 2. It is easiertounderstandparticularpath. 3. It can be changedaccordingto situation. 4. These are bestsuitedforcalculatingdiscounts,commissionsorinventorycontrol procedures. 5. The structure of decisiontable promotesalogicallycomplete andconsistentproblemdefinition. Disadvantages of DecisionTable 1. It cannot expressthe completesequence of operationstosolve aproblemtherefore itmaybe difficultforthe programmertotranslate decisiontable intoprogram. 2. If there are too manyalternatives,itisdifficulttolistindecisiontable. 3. It doesnot showthe flowof logicfor the solutiontoa givenproblem. Let's create a decision table for a login screen. The conditionissimple if the userprovidescorrectusername andpasswordthe userwill be redirected to the homepage.If anyof the inputiswrong,an errormessage will be displayed. Conditions Rule 1 Rule 2 Rule 3 Rule 4 Username (T/F) F T F T Password (T/F) F F T T
  • 3. Output (E/H) E E E H Legend:  T – Correct username/password  F – Wrong username/password  E – Error message isdisplayed  H – Home screenisdisplayed Interpretation:  Case 1 – Username andpasswordbothwere wrong.The useris shownanerror message.  Case 2 – Username wascorrect,but the passwordwaswrong.The useris shownanerror message.  Case 3 – Username waswrong,but the passwordwascorrect.The useris shownanerror message.  Case 4 – Username andpasswordbothwere correct,and the usernavigatedtohomepage While convertingthistotestcase,we can create 2 scenarios,  Enter correctusername andcorrect password andclick onlogin,andthe expectedresultwill be the usershouldbe navigatedtohomepage Andone from the belowscenario  Enter wrongusername andwrongpasswordandclickon login,andthe expectedresultwill be the usershouldgetan error message  Enter correctusername andwrongpasswordand clickon login,andthe expectedresultwillbe the usershouldgetan error message  Enter wrongusername andcorrectpasswordand clickon login,andthe expectedresultwillbe the usershouldgetan error message As theyessentiallytestthe same rule. Example 2: How to make DecisionTable for Upload Screen Nowconsidera dialogue box whichwill askthe usertouploadphotowithcertainconditionslike – 1. You can uploadonly'.jpg'formatimage
  • 4. 2. file size lessthan32kb 3. resolution137*177. If any of the conditionsfailsthe systemwillthrow correspondingerrormessage statingthe issue andif all conditionsare metphotowill be updatedsuccessfully Let's create the decisiontable forthiscase. Conditions Case 1 Case 2 Case 3 Case 4 Case 5 Case 6 Case 7 Case 8 Format .jpg .jpg .jpg .jpg Not.jpg Not.jpg Not.jpg Not.jpg Size Lessthan 32kb Lessthan 32kb >= 32kb >= 32kb Lessthan 32kb Lessthan 32kb >= 32kb >= 32kb resolution 137*177 Not 137*177 137*177 Not 137*177 137*177 Not 137*177 137*177 Not 137*177 Output Photo uploaded Error message resolution mismatch Error message size mismatch Error message size and resolution mismatch Error message for format mismatch Error message formatand resolution mismatch Error message for format and size mismatch Error message for format, size,and resolution mismatch For thiscondition,we cancreate 8 differenttestcasesandensure completecoverage basedonthe above table. 1. Uploada photowithformat'.jpg', size lessthan32kb and resolution137*177 and clickon upload.ExpectedresultisPhotoshoulduploadsuccessfully 2. Uploada photowithformat'.jpg',size lessthan32kb and resolutionnot137*177 and clickon upload.ExpectedresultisError message resolutionmismatchshouldbe displayed 3. Uploada photowithformat'.jpg',size more than 32kb and resolution137*177 and clickon upload.ExpectedresultisError message size mismatchshouldbe displayed
  • 5. 4. Uploada photowithformat'.jpg',size more than equal to32kb andresolutionnot137*177 and clickon upload.ExpectedresultisError message size andresolutionmismatchshouldbe displayed 5. Uploada photowithformatotherthan '.jpg',size lessthan32kb and resolution137*177 and clickon upload.ExpectedresultisError message forformatmismatchshouldbe displayed 6. Uploada photowithformatotherthan '.jpg',size lessthan32kb and resolutionnot137*177 and clickon upload.ExpectedresultisErrormessage formatand resolutionmismatchshould be displayed 7. Uploada photowithformatotherthan '.jpg',size more than32kb and resolution137*177 and clickon upload.ExpectedresultisError message forformatandsize mismatchshouldbe displayed 8. Uploada photowithformatotherthan '.jpg',size more than32kb and resolutionnot137*177 and clickon upload.ExpectedresultisErrormessage forformat,size andresolutionmismatch shouldbe displayed Q: An insurance companyusesthe followingrule todeterminethe eligibilityof adriverforinsurance. The driverwill be insuredif:- 1. The driverlivesinthe citywithpopulationlessthan5000 andhe ismarriedman. 2. The driverlivesinthe citywithpopulationlessthan5000 andhe ismarriedand age is over30 years old. 3. The driverlivesinthe citywithpopulationis5000 or more and it ismarriedfemale. 4. The driverismale over30. 5. The driverismarriedandunder30. Condition Rule1 Rule2 Rule3 Rule4 Rule5 Else Livesincity population<5000 Y Y N - - - Male Y - N Y - - Married Y Y Y - Y -
  • 6. Q: Studyfollowingconditionsanddrawa decisiontable:- 1. If productcode=A Andcustomertype=1 Andthe order amount<=700 Then5% discountallowed 2. If productcode=A Andcustomertype=2 Andthe order amount<=700 Then7.5% discountallowed 3. If productcode=A Andcustomertype=1 Andthe order amount>=700 Then7.5% discountallowed 4. If productcode=A Andcustomertype=2 Age>30 - Y - Y N - Action Rule1 Rule2 Rule3 Rule4 Rule5 Else Insured Y Y Y Y Y Uninsured Y
  • 7. Andthe order amount>700 Then10% discountallowed 5. A flatdiscountof 5% onproduct code=Bregardlessof customertype andthe orderamount Q: Draw a decision table fora company withthree person A,B,Cwhose share inthe companyare 50%,20%,30% sequentially.Anylow arisesinthe companywill be passedif itis supportedbyshare holdersandwhose share holdingexceed2/3of the total shares. Condition Rule1 Rule2 Else A 50% Y Y - B 20% N Y - C 30% Y N - Action Rule1 Rule2 Else Low Passed Y Y Condition Rule1 Rule2 Rule3 Rule4 Rule5 Else Product code=A Y Y Y Y N - Customer type=1 Y N Y N - - Order amount<=700 Y Y N N - - Action Rule1 Rule2 Rule3 Rule4 Rule5 Else Discount5% Y Y Discount 7.5% Y Y Discount10% Y No Discount Y
  • 8. Low Rejected N Q: A Co-operatingbankxyzgrantedloanunderfollowingconditionsdraw decisiontableandtree- 1. If a customerhas a account withthe bankand has no loanoutstanding(nodues),loanwill be granted. 2. If a customerhas an account isoutstandingfrompreviousloan,loanwill be grantedif special managementapproval isobtained. 3. Rejectloanapplicationinall othercases. Condition Rule1 Rule2 Else CustomerhasAccount Y Y - No Out-standingloan amount Y N - Special ManagementApproval - Y - Action Rule1 Rule2 Else Loan ApplicationAccept Y Y Loan ApplicationReject