Download presentation
1
Decision Tables
2
Lesson Objectives Understand how to model complicated logic using a logic table Determine logical conditions and consequential actions.
3
An overview Decision tables are a precise yet compact way to model complicated logic. Just like IF-else statements Decision tables link conditions with actions The advantage of decision tables is that we can join many separate conditions with several actions
4
An Example Take the following bit of code
IF X is greater than 6 n Y is less than 7 Then Output “Pass” Else Output “Fail” Conditions X > 6 Y N Y < 7 Actions Output “Pass” X Output “Fail”
5
Why have them? Decision tables make it easier to observe that all possible conditions are accounted for. Decision tables can be used for: Specifying complex program logic Generating test cases (Also known as logic-based testing)
6
Have a go Complete a decision table for the following logic
If X is greater than 6 and Y is less than 7 or Z is equal to 3 Then Output “Pass” Else Output “Fail”
7
Have another go! Create a decision table for the following program in an office system Send when Recipient address present, subject present, before 5:30pm If after 5:30pm then put in pending folder If Recipient address missing or subject message, give warning message
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.