SlideShare a Scribd company logo
1 of 8
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

Similar to Decision tables

Applications of Rationalizability and Iterated DominanceEcon 4.docx
Applications of Rationalizability and Iterated DominanceEcon 4.docxApplications of Rationalizability and Iterated DominanceEcon 4.docx
Applications of Rationalizability and Iterated DominanceEcon 4.docxfestockton
 
CREDIT CARD FRAUD DETECTION USING PREDICTIVE MODELLING
CREDIT CARD FRAUD DETECTION USING PREDICTIVE MODELLINGCREDIT CARD FRAUD DETECTION USING PREDICTIVE MODELLING
CREDIT CARD FRAUD DETECTION USING PREDICTIVE MODELLINGIRJET Journal
 
AssumptionsAssumptionsPlant Capacity (megawatts)80Variable cost pe.docx
AssumptionsAssumptionsPlant Capacity (megawatts)80Variable cost pe.docxAssumptionsAssumptionsPlant Capacity (megawatts)80Variable cost pe.docx
AssumptionsAssumptionsPlant Capacity (megawatts)80Variable cost pe.docxrock73
 
Romanov moscow-boston-22.03, Business rules for profit incresing in mobile co...
Romanov moscow-boston-22.03, Business rules for profit incresing in mobile co...Romanov moscow-boston-22.03, Business rules for profit incresing in mobile co...
Romanov moscow-boston-22.03, Business rules for profit incresing in mobile co...Victor Romanov
 
Decisiontree&amp;game theory
Decisiontree&amp;game theoryDecisiontree&amp;game theory
Decisiontree&amp;game theoryDevaKumari Vijay
 
Neural Network Model
Neural Network ModelNeural Network Model
Neural Network ModelEric Esajian
 
Romanov moscow-spring sim2011-finished
Romanov moscow-spring sim2011-finishedRomanov moscow-spring sim2011-finished
Romanov moscow-spring sim2011-finishedVictor Romanov
 
Mobile company services fitting to customer consumtion profile-spring sim2011...
Mobile company services fitting to customer consumtion profile-spring sim2011...Mobile company services fitting to customer consumtion profile-spring sim2011...
Mobile company services fitting to customer consumtion profile-spring sim2011...Victor Romanov
 
ChapterTool KitChapter 1212912Corporate Valuation and Financial .docx
ChapterTool KitChapter 1212912Corporate Valuation and Financial .docxChapterTool KitChapter 1212912Corporate Valuation and Financial .docx
ChapterTool KitChapter 1212912Corporate Valuation and Financial .docxmccormicknadine86
 
Decision analysis
Decision analysisDecision analysis
Decision analysisTony Nguyen
 
Decision analysis
Decision analysisDecision analysis
Decision analysisJames Wong
 
Decision analysis
Decision analysisDecision analysis
Decision analysisFraboni Ec
 
Ame configuration process end to end
Ame configuration process end to endAme configuration process end to end
Ame configuration process end to enderpnavin-11i
 
6 Final Assignment of ME (2).docx
6 Final Assignment of ME (2).docx6 Final Assignment of ME (2).docx
6 Final Assignment of ME (2).docxIliyasSufiyan
 
Incident Management
 Incident Management Incident Management
Incident Managementiicecollege
 

Similar to Decision tables (20)

Applications of Rationalizability and Iterated DominanceEcon 4.docx
Applications of Rationalizability and Iterated DominanceEcon 4.docxApplications of Rationalizability and Iterated DominanceEcon 4.docx
Applications of Rationalizability and Iterated DominanceEcon 4.docx
 
CREDIT CARD FRAUD DETECTION USING PREDICTIVE MODELLING
CREDIT CARD FRAUD DETECTION USING PREDICTIVE MODELLINGCREDIT CARD FRAUD DETECTION USING PREDICTIVE MODELLING
CREDIT CARD FRAUD DETECTION USING PREDICTIVE MODELLING
 
AssumptionsAssumptionsPlant Capacity (megawatts)80Variable cost pe.docx
AssumptionsAssumptionsPlant Capacity (megawatts)80Variable cost pe.docxAssumptionsAssumptionsPlant Capacity (megawatts)80Variable cost pe.docx
AssumptionsAssumptionsPlant Capacity (megawatts)80Variable cost pe.docx
 
Romanov moscow-boston-22.03, Business rules for profit incresing in mobile co...
Romanov moscow-boston-22.03, Business rules for profit incresing in mobile co...Romanov moscow-boston-22.03, Business rules for profit incresing in mobile co...
Romanov moscow-boston-22.03, Business rules for profit incresing in mobile co...
 
Decisiontree&amp;game theory
Decisiontree&amp;game theoryDecisiontree&amp;game theory
Decisiontree&amp;game theory
 
Neural Network Model
Neural Network ModelNeural Network Model
Neural Network Model
 
Romanov moscow-spring sim2011-finished
Romanov moscow-spring sim2011-finishedRomanov moscow-spring sim2011-finished
Romanov moscow-spring sim2011-finished
 
Mobile company services fitting to customer consumtion profile-spring sim2011...
Mobile company services fitting to customer consumtion profile-spring sim2011...Mobile company services fitting to customer consumtion profile-spring sim2011...
Mobile company services fitting to customer consumtion profile-spring sim2011...
 
final
finalfinal
final
 
ChapterTool KitChapter 1212912Corporate Valuation and Financial .docx
ChapterTool KitChapter 1212912Corporate Valuation and Financial .docxChapterTool KitChapter 1212912Corporate Valuation and Financial .docx
ChapterTool KitChapter 1212912Corporate Valuation and Financial .docx
 
Decision analysis
Decision analysisDecision analysis
Decision analysis
 
Decision analysis
Decision analysisDecision analysis
Decision analysis
 
Decision analysis
Decision analysisDecision analysis
Decision analysis
 
Decision analysis
Decision analysisDecision analysis
Decision analysis
 
Decision analysis
Decision analysisDecision analysis
Decision analysis
 
Decision analysis
Decision analysisDecision analysis
Decision analysis
 
Ame configuration process end to end
Ame configuration process end to endAme configuration process end to end
Ame configuration process end to end
 
6 Final Assignment of ME (2).docx
6 Final Assignment of ME (2).docx6 Final Assignment of ME (2).docx
6 Final Assignment of ME (2).docx
 
Decision theory
Decision theoryDecision theory
Decision theory
 
Incident Management
 Incident Management Incident Management
Incident Management
 

Recently uploaded

School management system project report.pdf
School management system project report.pdfSchool management system project report.pdf
School management system project report.pdfKamal Acharya
 
Supermarket billing system project report..pdf
Supermarket billing system project report..pdfSupermarket billing system project report..pdf
Supermarket billing system project report..pdfKamal Acharya
 
Intelligent Agents, A discovery on How A Rational Agent Acts
Intelligent Agents, A discovery on How A Rational Agent ActsIntelligent Agents, A discovery on How A Rational Agent Acts
Intelligent Agents, A discovery on How A Rational Agent ActsSheetal Jain
 
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5T.D. Shashikala
 
Furniture showroom management system project.pdf
Furniture showroom management system project.pdfFurniture showroom management system project.pdf
Furniture showroom management system project.pdfKamal Acharya
 
Low rpm Generator for efficient energy harnessing from a two stage wind turbine
Low rpm Generator for efficient energy harnessing from a two stage wind turbineLow rpm Generator for efficient energy harnessing from a two stage wind turbine
Low rpm Generator for efficient energy harnessing from a two stage wind turbineAftabkhan575376
 
Arduino based vehicle speed tracker project
Arduino based vehicle speed tracker projectArduino based vehicle speed tracker project
Arduino based vehicle speed tracker projectRased Khan
 
BURGER ORDERING SYSYTEM PROJECT REPORT..pdf
BURGER ORDERING SYSYTEM PROJECT REPORT..pdfBURGER ORDERING SYSYTEM PROJECT REPORT..pdf
BURGER ORDERING SYSYTEM PROJECT REPORT..pdfKamal Acharya
 
Attraction and Repulsion type Moving Iron Instruments.pptx
Attraction and Repulsion type Moving Iron Instruments.pptxAttraction and Repulsion type Moving Iron Instruments.pptx
Attraction and Repulsion type Moving Iron Instruments.pptxkarthikeyanS725446
 
Construction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptxConstruction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptxwendy cai
 
The battle for RAG, explore the pros and cons of using KnowledgeGraphs and Ve...
The battle for RAG, explore the pros and cons of using KnowledgeGraphs and Ve...The battle for RAG, explore the pros and cons of using KnowledgeGraphs and Ve...
The battle for RAG, explore the pros and cons of using KnowledgeGraphs and Ve...Roi Lipman
 
ChatGPT Prompt Engineering for project managers.pdf
ChatGPT Prompt Engineering for project managers.pdfChatGPT Prompt Engineering for project managers.pdf
ChatGPT Prompt Engineering for project managers.pdfqasastareekh
 
Filters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsFilters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsMathias Magdowski
 
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWINGBRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWINGKOUSTAV SARKAR
 
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical EngineeringC Sai Kiran
 
ROAD CONSTRUCTION PRESENTATION.PPTX.pptx
ROAD CONSTRUCTION PRESENTATION.PPTX.pptxROAD CONSTRUCTION PRESENTATION.PPTX.pptx
ROAD CONSTRUCTION PRESENTATION.PPTX.pptxGagandeepKaur617299
 
Artificial Intelligence Bayesian Reasoning
Artificial Intelligence Bayesian ReasoningArtificial Intelligence Bayesian Reasoning
Artificial Intelligence Bayesian Reasoninghotman30312
 
How to Design and spec harmonic filter.pdf
How to Design and spec harmonic filter.pdfHow to Design and spec harmonic filter.pdf
How to Design and spec harmonic filter.pdftawat puangthong
 
Electrical shop management system project report.pdf
Electrical shop management system project report.pdfElectrical shop management system project report.pdf
Electrical shop management system project report.pdfKamal Acharya
 
Electrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission lineElectrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission lineJulioCesarSalazarHer1
 

Recently uploaded (20)

School management system project report.pdf
School management system project report.pdfSchool management system project report.pdf
School management system project report.pdf
 
Supermarket billing system project report..pdf
Supermarket billing system project report..pdfSupermarket billing system project report..pdf
Supermarket billing system project report..pdf
 
Intelligent Agents, A discovery on How A Rational Agent Acts
Intelligent Agents, A discovery on How A Rational Agent ActsIntelligent Agents, A discovery on How A Rational Agent Acts
Intelligent Agents, A discovery on How A Rational Agent Acts
 
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
 
Furniture showroom management system project.pdf
Furniture showroom management system project.pdfFurniture showroom management system project.pdf
Furniture showroom management system project.pdf
 
Low rpm Generator for efficient energy harnessing from a two stage wind turbine
Low rpm Generator for efficient energy harnessing from a two stage wind turbineLow rpm Generator for efficient energy harnessing from a two stage wind turbine
Low rpm Generator for efficient energy harnessing from a two stage wind turbine
 
Arduino based vehicle speed tracker project
Arduino based vehicle speed tracker projectArduino based vehicle speed tracker project
Arduino based vehicle speed tracker project
 
BURGER ORDERING SYSYTEM PROJECT REPORT..pdf
BURGER ORDERING SYSYTEM PROJECT REPORT..pdfBURGER ORDERING SYSYTEM PROJECT REPORT..pdf
BURGER ORDERING SYSYTEM PROJECT REPORT..pdf
 
Attraction and Repulsion type Moving Iron Instruments.pptx
Attraction and Repulsion type Moving Iron Instruments.pptxAttraction and Repulsion type Moving Iron Instruments.pptx
Attraction and Repulsion type Moving Iron Instruments.pptx
 
Construction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptxConstruction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptx
 
The battle for RAG, explore the pros and cons of using KnowledgeGraphs and Ve...
The battle for RAG, explore the pros and cons of using KnowledgeGraphs and Ve...The battle for RAG, explore the pros and cons of using KnowledgeGraphs and Ve...
The battle for RAG, explore the pros and cons of using KnowledgeGraphs and Ve...
 
ChatGPT Prompt Engineering for project managers.pdf
ChatGPT Prompt Engineering for project managers.pdfChatGPT Prompt Engineering for project managers.pdf
ChatGPT Prompt Engineering for project managers.pdf
 
Filters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsFilters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility Applications
 
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWINGBRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
 
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
 
ROAD CONSTRUCTION PRESENTATION.PPTX.pptx
ROAD CONSTRUCTION PRESENTATION.PPTX.pptxROAD CONSTRUCTION PRESENTATION.PPTX.pptx
ROAD CONSTRUCTION PRESENTATION.PPTX.pptx
 
Artificial Intelligence Bayesian Reasoning
Artificial Intelligence Bayesian ReasoningArtificial Intelligence Bayesian Reasoning
Artificial Intelligence Bayesian Reasoning
 
How to Design and spec harmonic filter.pdf
How to Design and spec harmonic filter.pdfHow to Design and spec harmonic filter.pdf
How to Design and spec harmonic filter.pdf
 
Electrical shop management system project report.pdf
Electrical shop management system project report.pdfElectrical shop management system project report.pdf
Electrical shop management system project report.pdf
 
Electrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission lineElectrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission line
 

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