Decision-Table Test Case Generation. DT terminology 2.

Presentation on theme: "Decision-Table Test Case Generation. DT terminology 2."— Presentation transcript:

Decision-Table Test Case Generation

DT terminology 2

Limited entry tables: Condition entries have binary values Extended entry tables: Condition entries have more than two values (values in a set) 3

A sample DT 4

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 5

DT for the triangle problem 6

DT for the triangle problem refined 7

The triangle problem test cases 8

DT rule counting 9

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 10

NexDate: the first try 11

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 12

NextDate: first try (partial) 13

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) } 14

NextDate: second try, first part 15

NextDate: second try, second part 16

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) } 17

NextDate: third try first part 18

NextDate: third try second part 19

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} 20

NextDate: as extended entries (first half) 21

NextDate: as extended entries (second half) 22

NextDate: as extended entries (first half reduced) 23

NextDate: as extended entries (second half reduced) 24

NextDate test cases 25