DecisionTable Test Case Generation DT terminology 2 DT
Decision-Table Test Case Generation
DT terminology 2
DT terminology • 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 Next. Date problem • The Next. Date problem illustrates the correspondence between equivalence classes and decision table structure • The Next. Date 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
Nex. Date: 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
Next. Date: first try (partial) 13
Next. Date: a second try M 1 = {month : 1. . 12 | days(month) = 30 } M 2 = {month : 1. . 12 | days(month) = 31 } M 3 = {month : {2} } (i. e. , the month is February) D 1 = {day : 1. . 28} D 2 = {day : {29} } D 3 = {day : {30} } D 4 = {day : {31} } Y 1 = {year : {2000} } Y 2 = {year : 1812. . 2012 | leap_year (year) ∧ year ≠ 2000 } Y 3 = {year : 1812. . 2012 | common_year (year) } 14
Next. Date: second try, first part 15
Next. Date: second try, second part 16
Next. Date: third try M 1 = {month : 1. . 12 | days(month) = 30 } M 2 = {month : 1. . 12 | days(month) = 31 ∧ month ≠ 12 } M 3 = {month : {12} } (a special EC for December) M 4 = {month : {2} } (February) D 1 = {day : 1. . 27} D 2 = {day : {28} } D 3 = {day : {29} } D 4 = {day : {30} } D 5 = {day : {31} } Y 1 = {year : 1812. . 2012 | leap_year (year) } Y 2 = {year : 1812. . 2012 | common_year (year) } 17
Next. Date: third try first part 18
Next. Date: third try second part 19
Next. Date: final version • Month: – M 1 = { month : month has 30 days} – M 2 = { month : month has 31 days except December} – M 3 = { month : month is February} – M 4 = {month : month is December} • Day – D 1 = {day : 1 <= day <= 27} – D 2 = {day : day = 28 } – D 3 = {day : day = 29 } – D 4 = {day : day = 30 } – D 5 = {day : day = 31 } • Year (are these disjoint? ) – Y 1 = {year : year is a leap year} – Y 2 = {year : year is a common year} 20
Next. Date: as extended entries (first half) 21
Next. Date: as extended entries (second half) 22
Next. Date: as extended entries (first half reduced) 23
Next. Date: as extended entries (second half reduced) 24
Next. Date test cases 25
- Slides: 25