14
 Decision Table s A useful testing technique and more… Marien de Wilde, Project Manager IBM New Zealand Ltd, 021 - 474 018 © Copyright IBM New Zealand Ltd, June 2002

Decision+Table+Training+ a+Useful+Testing+Technique

Embed Size (px)

Citation preview

Page 1: Decision+Table+Training+ a+Useful+Testing+Technique

8/22/2019 Decision+Table+Training+ a+Useful+Testing+Technique

http://slidepdf.com/reader/full/decisiontabletraining-ausefultestingtechnique 1/14

 Decision Tables

A useful testing technique and

more… 

Marien de Wilde, Project Manager 

IBM New Zealand Ltd, 021 - 474 018

© Copyright IBM New Zealand Ltd, June 2002

Page 2: Decision+Table+Training+ a+Useful+Testing+Technique

8/22/2019 Decision+Table+Training+ a+Useful+Testing+Technique

http://slidepdf.com/reader/full/decisiontabletraining-ausefultestingtechnique 2/14

June 2002 2

 In this session … 

Definition

Application areas

Steps to create a

decision table

ExerciseSolution to exercise

Page 3: Decision+Table+Training+ a+Useful+Testing+Technique

8/22/2019 Decision+Table+Training+ a+Useful+Testing+Technique

http://slidepdf.com/reader/full/decisiontabletraining-ausefultestingtechnique 3/14

June 2002 3

 Definition

Components

A decision table lists

causes and effects in amatrix. Each column

represents a unique

combination.

Purpose is to structure

logic

Cause = condition

Effect = action = expected results

Causes Values 1 2 3 4 5 6 7 8

Cause 1 Y, N   Y Y Y Y N N N N

Cause 2 Y, N   Y Y N N Y Y N N

Cause 3 Y, N   Y N Y N Y N Y N

Effects

Effect 1 X X X

Effect 2  X X X

Combinations

Page 4: Decision+Table+Training+ a+Useful+Testing+Technique

8/22/2019 Decision+Table+Training+ a+Useful+Testing+Technique

http://slidepdf.com/reader/full/decisiontabletraining-ausefultestingtechnique 4/14

June 2002 4

 Application Areas

Business Analysis

Programming

Testing

Hardware Design

etc

Page 5: Decision+Table+Training+ a+Useful+Testing+Technique

8/22/2019 Decision+Table+Training+ a+Useful+Testing+Technique

http://slidepdf.com/reader/full/decisiontabletraining-ausefultestingtechnique 5/14

June 2002 5

Steps to Create a decision table

1. 1. List all causes in the decision

table

2. 2. Calculate the number of  possible combinations

3. 3. Fill columns with all possible

combinations

4. 4. Reduce test combinations

5. 5. Check covered combinations

6. 6. Add effects to the table

Page 6: Decision+Table+Training+ a+Useful+Testing+Technique

8/22/2019 Decision+Table+Training+ a+Useful+Testing+Technique

http://slidepdf.com/reader/full/decisiontabletraining-ausefultestingtechnique 6/14

June 2002 6

Step 1: List all causes

Hints:

Write down the values

the cause/conditioncan assume

Cluster related causes

Put the mostdominating cause first

Put multi valued

causes last

Causes Values 1 2 3

Cause 1 Y, N   Y Y Y

Cause 2 Y, N   Y Y N

Cause 3 Y, N   Y N Y

Effects

Effect 1 X

Effect 2  X

Com

Page 7: Decision+Table+Training+ a+Useful+Testing+Technique

8/22/2019 Decision+Table+Training+ a+Useful+Testing+Technique

http://slidepdf.com/reader/full/decisiontabletraining-ausefultestingtechnique 7/14

June 2002 7

Step 2: Calculate combinations

If all causes are simply Y/N

values:

2number of causes

If 1 cause with 3 values and 3

with 2:

31 * 23 = 24

Or, use the Values column

and multiply each value

down the column, eg.

3*2*2*2=24

 Number of Values to

the power of the

number of causes

with these values

Page 8: Decision+Table+Training+ a+Useful+Testing+Technique

8/22/2019 Decision+Table+Training+ a+Useful+Testing+Technique

http://slidepdf.com/reader/full/decisiontabletraining-ausefultestingtechnique 8/14

June 2002 8

Step 3: Fill columns

Algorithm:

1. Determine Repeating Factor (RF):

divide remaining combinations by thenumber of possible values for that

cause

2. Write RF times the first value, then

RF times the next etc. until row is full

3.  Next row, go to 1.

s Values 1 2 3 4 5 6 7 8

1 Y, N   Y Y Y Y N N N N

2 Y, N   Y Y N N Y Y N N

3 Y, N   Y N Y N Y N Y N

s

t 1 X X X

t 2  X X X

Combinations

Page 9: Decision+Table+Training+ a+Useful+Testing+Technique

8/22/2019 Decision+Table+Training+ a+Useful+Testing+Technique

http://slidepdf.com/reader/full/decisiontabletraining-ausefultestingtechnique 9/14

June 2002 9

Step 4: Reduce combinations

Find indifferentcombinations – placea „-‟ 

Causes Values 1 2 3 4 5 6 7 8

Cause 1 Y, N   Y Y Y Y N N N N

Cause 2 Y, N   Y Y N N Y Y N N

Cause 3 Y, N   Y N - - Y N Y NEffects

Effect 1 X X X

Effect 2  X X X

Combinations

Causes Values 1 2 3 4 5 6 7

Cause 1 Y, N   Y Y Y N N N N

Cause 2 Y, N   Y Y N Y Y N N

Cause 3 Y, N   Y N - Y N Y N

Effects

Effect 1 X X

Effect 2  X X X

Combinations

Join columns wherecolumns are identical

Tip: ensure the effectsare the same

Page 10: Decision+Table+Training+ a+Useful+Testing+Technique

8/22/2019 Decision+Table+Training+ a+Useful+Testing+Technique

http://slidepdf.com/reader/full/decisiontabletraining-ausefultestingtechnique 10/14

June 2002 10

Step 5: Check covered 

combinations

Checksum

For each column calculate the

combinations it represents

A „-‟ represents as many

combinations as the cause has

Multiply for each „-‟ down the

column

Add up total and compare with

step 2

Causes Values 1 2 3 4

Cause 1 Y, N   Y Y Y N

Cause 2 Y, N   Y N N -

Cause 3 Y, N   - Y N -

Effects

Effect 1 X X

Effect 2 

Checksum 2 1 1 4 8

Combinations

Page 11: Decision+Table+Training+ a+Useful+Testing+Technique

8/22/2019 Decision+Table+Training+ a+Useful+Testing+Technique

http://slidepdf.com/reader/full/decisiontabletraining-ausefultestingtechnique 11/14

June 2002 11

Step 6: Add effects to table

Read column by

column and determine

the effectsOne effect can occur 

in multiple test

combinations

Causes Values 1 2 3 4

Cause 1 Y, N   Y Y Y N

Cause 2 Y, N   Y N N -

Cause 3 Y, N   - Y N -

Effects

Effect 1 X X

Effect 2  X X

Checksum 2 1 1 4 8

Combinations

Page 12: Decision+Table+Training+ a+Useful+Testing+Technique

8/22/2019 Decision+Table+Training+ a+Useful+Testing+Technique

http://slidepdf.com/reader/full/decisiontabletraining-ausefultestingtechnique 12/14

June 2002 12

 Exercise: Specification

Create a decision table

A mailing is to be sent out to customers. Thecontent of the mailing is about the current levelof discounting and potential levels of discounting. The content is different for differenttypes of customers.

Customer Types A, B and C get a normal letter except Customer Type C, who get a special letter.Any customer with 2 or more current lines or with a credit rating of „X‟ get a special paragraphadded with an offer to subscribe to another levelof discounting.

Page 13: Decision+Table+Training+ a+Useful+Testing+Technique

8/22/2019 Decision+Table+Training+ a+Useful+Testing+Technique

http://slidepdf.com/reader/full/decisiontabletraining-ausefultestingtechnique 13/14

June 2002 13

 Exercise: possible solution

“2 or more current lines OR  credit rating X”. What if both: AND?

Other customer types? See “O-Other” above. 

What about non current lines?

Causes Values 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Customer Type A,B,C,O A A A A B B B B C C C C O O O O

2 or more lines Y, N   Y Y N N Y Y N N Y Y N N Y Y N N

Credit rating = X Y, N  Y N Y N Y N Y N Y N Y N Y N Y NEffects

Normal Letter  X X X X X X X X ? ? ? ?

Special Letter  X X X X ? ? ? ?

 Add. Paragraph ? X X ? X X ? X X ? ? ? ?

No Letter  ? ? ? ?

Checksum 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16

Combinations

Page 14: Decision+Table+Training+ a+Useful+Testing+Technique

8/22/2019 Decision+Table+Training+ a+Useful+Testing+Technique

http://slidepdf.com/reader/full/decisiontabletraining-ausefultestingtechnique 14/14

June 2002 14

Thank You