Decision table method to design test cases

Big question: I don't feel right at all! 13, 14, 15, 16

The test case is wrong, the first one is wrong! ! !

 

Suppose a program has three input variables year, month, and day (month, day, and year are all integer values, and meet: 1≤month≤12, 1≤day≤31 and 1981≤year≤2050), respectively as the input date Year, month, day, through the program can output the date of the input date on the calendar every other day. Try the decision table method to design test cases under the correct input conditions of the program.

 

design:

1. Determine the rules and establish condition and action stakes

M1={Month: 30 days per month}

M2={Month: 31 days a month, except December}

M3={Month: December}

M4={Month: February}

D1={Date: 1<=Date<=26}  

D2={Date: 27}  

D3={Date: 28}

D4={Date: 29}

D5={Date: 30}  

D6={Date: 31}

Y1 = {year: year is a leap year}  

Y2 = {year: year is not a leap year}

2. Judgment Table

 

3. Test cases:

 

Example ID

Use case title

Precondition

enter

Output

1

Day+2(30)

 

1. Enter 1 month

2. Enter 26 for the day

3. Enter the year 2010

2010.1.28

2

Day=1&month+1(30)

 

1. Month enter 3

2. Enter 29 for the day

3. Enter 2010

2010.4.1

3

Day=2&month+1(30)

 

1. Enter 5 for the month

2. Enter 30 for the day

3. Enter 2010

2010.6.2

4

Day+2(31)

 

1. Month enter 4

2. Enter 25 for the day

3. Enter 2010

2010.4.27

5

Day=1&month+1(31)

 

1. Month enter 11

2. Enter 30 for the day

3. Enter 2010

2010.12.1

6

Day=2&month+1(31)

 

1. Month enter 11

2. Enter 31 for the day

3. Enter 2010

2010.12.2

7

Day+2 (December)

 

1. Enter 12 for the month

2. Enter 23 for the day

3. Enter 2010

2010.12.25

8

Day=1&month+1&year+1(12月)

 

1. Enter 12 for the month

2. Enter 30 for the day

3. Enter 2010

2011.1.1

9

Day=2&month+1&year+1(12月)

 

1. Enter 12 for the month

2. Enter 31 for the day

3. Enter 2010

2010.1.2

10

Day+2 (February)

 

1. Month enter 2

2. Enter 19 on the day

3. Enter 2010

2010.2.21

11

Day+2 (February in leap year)

 

1. Month enter 2

2. Enter 27 on the day

3. Enter 2000 in the year

2000.2.29

12

Day=1&month+1(闰年2月)

 

1.月输入2

2.日输入28

3.年输入2000

2000.3.1

13

Day=2&month+1(闰年2月)

 

1.月输入2

2.日输入29

3.年输入2000

2000.3.2

14

Day=2&month+1(平年2月)

 

1.月输入2

2.日输入27

3.年输入2001

2001.3.2

15

Day=1&month+1(平年2月)

 

1.月输入2

2.日输入26

3.年输入2001

2001.3.1

Guess you like

Origin blog.csdn.net/sunshine04/article/details/108303700