Decision-Table Test Case Generation. DT terminology 2.

25
Decision-Table Test Case Generation

Transcript of Decision-Table Test Case Generation. DT terminology 2.

Page 1: Decision-Table Test Case Generation. DT terminology 2.

Decision-Table Test Case Generation

Page 2: Decision-Table Test Case Generation. DT terminology 2.

2

DT terminology

Page 3: Decision-Table Test Case Generation. DT terminology 2.

3

DT terminology

• Limited entry tables: Condition entries have binary values• Extended entry tables: Condition entries have more

than two values (values in a set)

Page 4: Decision-Table Test Case Generation. DT terminology 2.

4

A sample DT

Page 5: Decision-Table Test Case Generation. DT terminology 2.

5

DT test cases

• Conditions are interpreted as• Input• Equivalence classes of inputs

• Actions are interpreted as• Output• Major functional processing portions

• Complete decision tables• Complete set of test cases

Page 6: Decision-Table Test Case Generation. DT terminology 2.

6

DT for the triangle problem

Page 7: Decision-Table Test Case Generation. DT terminology 2.

7

DT for the triangle problem refined

Page 8: Decision-Table Test Case Generation. DT terminology 2.

8

The triangle problem test cases

Page 9: Decision-Table Test Case Generation. DT terminology 2.

9

DT rule counting

Page 10: Decision-Table Test Case Generation. DT terminology 2.

10

The NextDate problem

• The NextDate problem illustrates the correspondence between equivalence classes and decision table structure• The NextDate problem illustrates the problem of

dependencies in the input domain• Decision tables can highlight such dependencies• Impossible dates can be clearly marked as a separate

action

Page 11: Decision-Table Test Case Generation. DT terminology 2.

11

NexDate: the first try

Page 12: Decision-Table Test Case Generation. DT terminology 2.

12

Mutually exclusive conditions• Because a month is in an equivalence class we

cannot have T in more than one entry; the “do not care entries” are really F

Page 13: Decision-Table Test Case Generation. DT terminology 2.

13

NextDate: first try (partial)

Page 14: Decision-Table Test Case Generation. DT terminology 2.

14

NextDate: a second try

M1 = {month : 1 .. 12 | days(month) = 30 }M2 = {month : 1 .. 12 | days(month) = 31 }M3 = {month : {2} } (i.e., the month is February)D1 = {day : 1 .. 28}D2 = {day : {29} }D3 = {day : {30} }D4 = {day : {31} }Y1 = {year : {2000} }Y2 = {year : 1812 .. 2012 | leap_year (year) year ≠ 2000 }∧

Y3 = {year : 1812 .. 2012 | common_year (year) }

Page 15: Decision-Table Test Case Generation. DT terminology 2.

15

NextDate: second try, first part

Page 16: Decision-Table Test Case Generation. DT terminology 2.

16

NextDate: second try, second part

Page 17: Decision-Table Test Case Generation. DT terminology 2.

17

NextDate: third try

M1 = {month : 1 .. 12 | days(month) = 30 }M2 = {month : 1 .. 12 | days(month) = 31 month ≠ 12 }∧M3 = {month : {12} } (a special EC for December)M4 = {month : {2} } (February)D1 = {day : 1 .. 27}D2 = {day : {28} }D3 = {day : {29} }D4 = {day : {30} }D5 = {day : {31} }Y1 = {year : 1812 .. 2012 | leap_year (year) }Y2 = {year : 1812 .. 2012 | common_year (year) }

Page 18: Decision-Table Test Case Generation. DT terminology 2.

18

NextDate: third try first part

Page 19: Decision-Table Test Case Generation. DT terminology 2.

19

NextDate: third try second part

Page 20: Decision-Table Test Case Generation. DT terminology 2.

20

NextDate: final version

• Month:– M1 = { month : month has 30 days}– M2 = { month : month has 31 days except December}– M3 = { month : month is February}– M4 = {month : month is December}

• Day– D1 = {day : 1 <= day <= 27}– D2 = {day : day = 28 }– D3 = {day : day = 29 }– D4 = {day : day = 30 }– D5 = {day : day = 31 }

• Year (are these disjoint?)– Y1 = {year : year is a leap year}– Y2 = {year : year is a common year}

Page 21: Decision-Table Test Case Generation. DT terminology 2.

21

NextDate: as extended entries (first half)

Page 22: Decision-Table Test Case Generation. DT terminology 2.

22

NextDate: as extended entries (second half)

Page 23: Decision-Table Test Case Generation. DT terminology 2.

23

NextDate: as extended entries (first half reduced)

Page 24: Decision-Table Test Case Generation. DT terminology 2.

24

NextDate: as extended entries (second half reduced)

Page 25: Decision-Table Test Case Generation. DT terminology 2.

25

NextDate test cases