Developing A Software Component Design Specification
Developing A Software Component Design Specification
Lets take an example scenario for an ATM where a decision table would be
of use.
A customer requests a cash withdrawal. One of the business rules for the
ATM is that the ATM machine pays out the amount if the customer has
sufficient funds in their account or if the customer has the credit granted.
Already, this simple example of a business rule is quite complicated to
describe in text. A decision table makes the same requirements clearer to
understand:
Decision tables can be used in all situations where the outcome depends on
the combinations of different choices, and that is usually very often. In many
systems there are tons of business rules where decision tables add a lot of
value.
Express conditions and resulting actions in a list so that they are either TRUE
or FALSE. In this case there are two conditions, withdrawal amount
balance and credit granted. There is one result, the withdrawal is granted.
conditions
. In this case 22 = 4
The bottom line is that you should create more smaller decision tables
instead of fewer larger ones, otherwise you run the risk of the decision
tables being so large as to be unmanageable. Test the technique by picking
areas with fewer business rules.
Now is the time to fill in the T (TRUE) and F (FALSE) for the conditions. How
do you do that? The simplest is to say that it should look like this:
Row 1: TF
Row 2: TTFF
Row 3: TTTTFFFF
For each row, there is twice as many T and F as the previous line.
Repeat the pattern above from left to right for the entire row. In other words,
for a table with 8 columns, the first row will read TFTFTFTF, the second row
will read TTFFTTFF and the third row will read TTTTFFFF.
Tip: There are Excel templates to fill in decision tables if you need help.
Check for invalid combinations. Invalid combinations are those that cannot
happen, for example, that someone is both an infant and senior. Mark them
somehow, e.g. with X. In this example, there are no invalid combinations.
Finish by removing duplicate columns. In this case, the first and third column
are equal, therefore one of them is removed.
Test case for R2: balance = 100, requested withdrawal = 200, credit
granted. Expected result: withdrawal granted.
Summary
Decision tables are a good way to describe requirements when there
are several business rules that interact together. Using decision
tables it becomes easier for the requirements specialist to write
requirements which cover all conditions. As to the tester, it becomes
easier for them to write complete test cases.
Write decision tables early, then theyll become useful for requirements
specialists, developers, end-users and testers.
http://reqtest.com/requirements-blog/a-guide-to-using-decision-tables/