So I need to make a Decision Table to test a bit of code. The code is simple and straight forward but requires two user inputs to determine two proceeding variables. This is why I need to make this more than a binary (true/false) table.
The user is prompted to input total income, this will, in turn, determine which bracket the user falls into. Then the user is prompted to input the amount of dependents, which will determine the final tax. Depending on the income bracket, a switch statement will then set tax = income * [certain percentage]. After this the amount of dependents will determine what percentage of the tax will be removed.
Essentially what I need to know is how to set up my Conditions, Actions, and Rules.
Here is an example of decision table but this one is binary (true/false)
I am using Java for the code but that isn't entirely relevant. What I need specifically is deciding what my Conditions should be, whether it's solely income or the combinations of income and dependents, etc. I do not need to write the code, just need to write the test table for it.
If anyone can help inform me as to what I should do or where I should look, that would be appreciated. I am willing to provide anymore information if need be!
Thanks!
If you understand, what the regular (binary) decision table is, then it'll be easy for you to get the extended table as well - the difference is in conditions only.
Conditions in the extended decision table can have more than two values. For example, in your case you have two conditions:
For Actions I'd choose the tax rate and the deduction amount - they depend on the bracket and on the number of dependents correspondingly.
Rules (=columns in the table) connect conditions and actions - for all the possible combinations of condition values you have a list of actions to perform. In your case these actions will be simply two numbers, which you will use in a tax formula.
(Frankly I don't see why you need a decision table in this case at all... I think, the tax formula with parameters, depending on income, will be enough)