Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 4: Decision Table Testing Software Testing

Similar presentations


Presentation on theme: "Chapter 4: Decision Table Testing Software Testing"— Presentation transcript:

1 Chapter 4: Decision Table Testing 322235 Software Testing
By Dr. Wararat Songpan (Rungworawut) Faculty of Computer Science, Department of Science, Khon Kaen University, Thailand การทดสอบซอฟต์แวร์

2 Decision Table Testing: DT
A decision table testing is basically an outstanding technique used in both testing and requirements management. It is a structured exercise to prepare requirements when dealing with complex business rules. Also, used in model complicated logic. Also called Pairwise Testing, Classification-Trees Testing. Helps to test all different combination inputs with associated output. Contains CONDITIONs(Input) and ACTIONS(Output) การทดสอบซอฟต์แวร์

3 Decision Table Testing: DT Log In Facebook example:
or Phone Password Expected Results

4 Decision Table Testing: DT Log In Facebook example:
or Phone F Password Expected Results Error: Incorrect

5 Decision Table Testing: DT Log In Facebook example:
or Phone F T Password Expected Results Error: Incorrect Please Confirm

6 Decision Table Testing: DT Log In Facebook example:
or Phone F T Password Expected Results Error: Incorrect Please Confirm Facebook Page is Processed

7 Decision Table Testing: DT
A decision table has 4 portions: Condition stub Condition entry Action stubs Action entry การทดสอบซอฟต์แวร์

8 Condition Entries There are 2 type of condition entries:
Condition entries binary values, they are called limited entry table. Condition entries have more than two values, they are called extended entry table. การทดสอบซอฟต์แวร์

9 Decision Table Testing: DT Log In Facebook example:
Condition Entry Condition Stubs Conditions Rule1 Rule2 Rule3 Rule4 or Phone F T Password Expected Results Error: Incorrect Please Confirm Facebook Page is Processed

10 Decision Table Testing: DT Log In Facebook example:
Conditions Rule1 Rule2 Rule3 Rule4 or Phone F T Password Expected Results Error: Incorrect Please Confirm Facebook Page is Processed Action Stubs Action Entry

11 Decision Table Testing: DT Log In Facebook example:
Condition Rule1 Rule2 Rule3 Rule4 or Phone F T Password Expected Results Error: Incorrect Please Confirm Facebook Page is Processed A rule = A test case No. of combination = No. of Condition1 value * No. of condition2 value = 2 * 2 = 4 rules or 4 test cases

12 Decision Table Testing: DT Log In Facebook example:
Conditions Rule1 Rule2 Rule3 Rule4 Rule5 Rule6 Rule7 Rule8 Rule9 or Phone Blank Invalid Valid Password Expected Results Error: Incorrect Please Confirm - Show page Login Page Facebook Page No. of combination = No. of Condition1 value * No. of condition2 value = 3 * 3 = 9 rules or 9 test cases No. of Condition1 and 2 are blank, Invalid, valid as 3 possible values.

13 Decision Table Testing: DT Library example:
Conditions Rule1 Rule2 Rule3 Rule4 Rule5 Rule6 Rule7 Rule8 User Registered? F T No Outstanding fees? Under Borrow limit? Borrow Book? No Yes No. of combination = No. of Condition1 value * No. of condition2 value * No. of Condition 3 value = 2 * 2 * 2 = 8 rules or 9 test cases

14 Decision Table Testing: DT Library example:
Condition Rule1 Rule2 Rule3 Rule4 Rule5 Rule6 Rule7 Rule8 User Registered? F T No Outstanding fees? Under Borrow limit? Borrow Book? No Yes

15 Decision Table Testing: DT Library example:
Conditions Rule1,2 Rule3 Rule4 Rule5 Rule6 Rule7 Rule8 User Registered? F T No Outstanding fees? Under Borrow limit? - Borrow Book? No Yes “-” or “?” means don’t care entry

16 Decision Table Testing: DT Library example:
Conditions Rule1,2 Rule3 Rule4 Rule5 Rule6 Rule7 Rule8 User Registered? F T No Outstanding fees? Under Borrow limit? - Borrow Book? No Yes

17 Decision Table Testing: DT Library example:
Conditions Rule1,2 Rule3,4 Rule5 Rule6 Rule7 Rule8 User Registered? F T No Outstanding fees? Under Borrow limit? - Borrow Book? No Yes

18 Decision Table Testing: DT Library example:
Conditions Rule1,2 Rule3,4 Rule5 Rule6 Rule7 Rule8 User Registered? F T No Outstanding fees? Under Borrow limit? - Borrow Book? No Yes

19 Decision Table Testing: DT Library example:
Conditions Rule1,2 Rule3,4 Rule5,6 Rule7 Rule8 User Registered? F T No Outstanding fees? Under Borrow limit? - Borrow Book? No Yes

20 Decision Table Testing: DT Library example:
Conditions Rule1,2 Rule3,4 Rule5,6 Rule7 Rule8 User Registered? F T No Outstanding fees? Under Borrow limit? - Borrow Book? No Yes

21 Decision Table Testing: DT Library example:
Conditions Rule1-4 Rule5,6 Rule7 Rule8 User Registered? F T No Outstanding fees? - Under Borrow limit? Borrow Book? No Yes

22 Condition stubs We can apply Equivalence Partitioning and Boundary Value Analysis techniques to only specific conditions or inputs. Although, if we have dissimilar inputs that result in different actions being taken or secondly we have a business rule to test that there are different combination of inputs which result in different actions. We use decision table to test these kinds of rules or logic. Tester can add more actions to show rules that are is impossible or not.

23 Decision Table Testing: DT Triangle example:
Conditions Rule 1 Rule 2 Rule 3 Rule 4 Rule 5 Rule 6 Rule 7 Rule 8 Rule 9 c1:a, b, c form of triangle? c2: a = b? c3: a = c? c4: b = c? F - T a1: Not a triangle a2: Scalene a3: Isosceles a4: Equilateral a5: Impossible x การทดสอบซอฟต์แวร์

24 Decision Table Testing: DT Triangle example (Refined):
Conditions Rule 1 Rule 2 Rule 3 Rule 4 Rule 5 Rule 6 Rule 7 Rule 8 Rule 9 Rule 10 Rule 11 c1:a < b + c ? c2: b< a + c ? c3: c < a + b ? c4: a = b? c5: a = c? c6: b = c? F - T a1: Not a triangle a2: Scalene a3: Isosceles a4: Equilateral a5: Impossible x การทดสอบซอฟต์แวร์

25 Test case design from decision table Triangle Example:
Test Case ID a b c Expected Results DT1 4 1 2 Not a Triangle DT2 DT3 DT4 5 Equilateral DT5 ? Impossible DT6 DT7 3 Isosceles DT8 DT9 DT10 DT11 Scalene การทดสอบซอฟต์แวร์

26 Decision Table Testing: DT Triangle example (Refined) with rule count:
Conditions Rule 1 Rule 2 Rule 3 Rule 4 Rule 5 Rule 6 Rule 7 Rule 8 Rule 9 Rule 10 Rule 11 c1:a < b + c ? c2: b< a + c ? c3: c < a + b ? c4: a = b? c5: a = c? c6: b = c? F - T Rule count 32 16 8 1 a1: Not a triangle a2: Scalene a3: Isosceles a4: Equilateral a5: Impossible x การทดสอบซอฟต์แวร์

27 Rule count for mutually exclusive conditions
M1 = {month: 1=<month<=12} M2 = {month: month <1} M3 = {month: month >12} Conditions Rule 1 Rule 2 Rule 3 c1: month in M1 ? c2: month in M2 ? c3: month in M3 ? T - Rule Count 4 a1 a2 a3 การทดสอบซอฟต์แวร์

28 Expanded Version =12 rule counts M1 = {month: 1=<month<=12}
Conditions 1.1 1.2 1.3 1.4 2.1 2.2 2.3 2.4 3.1 3.2 3.3 3.4 c1: month in M1? c2: month in M2? c3: month in M3? T F F F Rule count 1 a1: impossible a2: a3: =12 rule counts M1 = {month: 1=<month<=12} M2 = {month: month <1} M3 = {month: month >12} การทดสอบซอฟต์แวร์

29 Impossible Rules M1 = {month: 1=<month<=12}
Conditions 1.1 1.2 1.3 1.4 2.3 2.4 3.1 3.4 c1: month in M1? c2: month in M2? c3: month in M3? T F F F Rule count 1 a1: impossible a2: a3: x การทดสอบซอฟต์แวร์

30 Redundancy Rule in Decision Table
Conditions Rule 1-4 ( ) Rule 5 Rule 6 Rule 7 Rule 8 Rule 9 c1 c2 c3 T - F a1 a2 a3 x (An Inconsistent Decision Table) การทดสอบซอฟต์แวร์

31 Applied for EC in Decision Table Testing (First Try)
M1 = {month: month has 30 days} M2 = {month: month has 31 days} M3 = {month: month = February} D1 = {day: 1 =< day =< 28} D2 = {day: day = 29} D3 = {day: day = 30} D4 = {day: day = 31} Y1 = {year: year = 2000} Y2 = {year: year is leap year} Y3 = {year: year is common year} การทดสอบซอฟต์แวร์

32 1) Limited entry (1024 Rules)
Conditions Ec1: month in M1? Ec2: month in M2? Ec3: month in M3? Ec4: day in D1? Ec5: day in D2? Ec6: day in D3? Ec7: day in D4? Ec8: year in Y1? Ec9: year in Y2? Ec10:year in Y3? T a1: impossible a2: next date การทดสอบซอฟต์แวร์

33 Applied for EC in Decision Table Testing (Second Try)
M1 = {month: month has 30 days} M2 = {month: month has 31 days} M3 = {month: month = February} D1 = {day: 1 =< day =< 28} D2 = {day: day = 29} D3 = {day: day = 30} D4 = {day: day = 31} Y1 = {year: year = 2000} Y2 = {year: year is leap year} Y3 = {year: year is common year} การทดสอบซอฟต์แวร์

34 2) Extended Entry (36 rules)
Conditions Rule 1 Rule 2 Rule 3 Rule 4 Rule 5 Rule 6 Rule 7 Rule 8 Next Page -> c1: month in c2: day in c3: year in M1 D1 - D2 D3 D4 M2 Rule count 3 action a1: impossible a2: increment day a3: reset day a4: increment month a5: reset month a6: increment year x ? การทดสอบซอฟต์แวร์

35 2) Extended Entry (36 rules) Cont.
Conditions Rule 9 Rule 10 Rule 11 Rule 12 Rule 13 Rule 14 Rule 15 Rule 16 Rule 17 c1: month in c2: day in c3: year in M3 D1 Y1 Y2 Y3 D2 D3 - D4 Rule count 1 3 action a1: impossible a2: increment day a3: reset day a4: increment month a5: reset month a6: increment year x การทดสอบซอฟต์แวร์

36 Applied for EC in Decision Table Testing (Third Try)
M1 = {month: month has 30 days} M2 = {month: month has 31 days except December} M3 = {month: month = December} M4 = {month: month = February} D1 = {day: 1 =< day =< 27} D2 = {day: day = 28} D3 = {day: day = 29} D4 = {day: day = 30} D5 = {day: day = 31} Y1 = {year: year is leap year} Y2 = {year: year is common year} การทดสอบซอฟต์แวร์

37 3) Decision Table (the third try)
Conditions 1 2 3 4 5 6 7 8 9 10 Next Page -> c1: month in c2: day in c3: year in M1 D1 - D2 D3 D4 D5 M2 Rule count action a1: impossible a2: increment day a3: reset day a4: increment month a5: reset month a6: increment year X การทดสอบซอฟต์แวร์

38 3) Decision Table (the third try)(Cont.)
Conditions 11 12 13 14 15 16 17 18 19 20 21 22 c1: month in c2: day in c3: year in M3 D1 - D2 D3 D4 D5 M4 Y1 Y2 Rule count action a1: impossible a2: increment day a3: reset day a4: increment month a5: reset month a6: increment year X การทดสอบซอฟต์แวร์

39 Reduce redundancy rules
Conditions 1-3 4 5 6-9 10 c1: month in c2: day in c3: year in M1 D1, D2, D3 - D4 D5 M2 D1, D2, D3, D4 action a1: impossible a2: increment day a3: reset day a4: increment month a5: reset month a6: increment year X การทดสอบซอฟต์แวร์

40 Reduce redundancy rules
Conditions 11-14 15 16 17 18 19 20 21-22 c1: month in c2: day in c3: year in M3 D1, D2, D3, D4 - D5 M4 D1 D2 Y1 Y2 D3 D4, D5 Rule count action a1: impossible a2: increment day a3: reset day a4: increment month a5: reset month a6: increment year X การทดสอบซอฟต์แวร์

41 Test Cases design Next date example:
Test Case ID Month Day Year Expected Results 1-3 April 15 2001 April 16, 2001 4 30 May 1, 2001 5 31 Impossible 6-9 January January 16, 2001 10 February 1, 2001 11-14 December December 16, 2001 January 1, 2002 16 February February 15, 2001 17 28 2004 February 29, 2004 18 March 1, 2001 19 29 March 1, 2004 20 21,22 =13 Test cases การทดสอบซอฟต์แวร์

42 ATM (simple) Example Example scenario for an ATM where a decision table would be of use. A customer requests a cash withdrawal. One of the business rules for the ATM is that the ATM machine pays out the amount if the customer has sufficient funds in their account or if the customer has the credit granted. Already, this simple example of a business rule is quite complicated to describe in text. A decision table makes the same requirements clearer to understand: การทดสอบซอฟต์แวร์

43 ATM (simple) Example Step 1 – Analyze the requirement and create the first column Requirement: “Withdrawal is granted if requested amount is covered by the balance or if the customer is granted credit to cover the withdrawal amount”. Conditions Withdrawal Amount <= Balance? Credit Granted? Actions Withdrawal granted การทดสอบซอฟต์แวร์

44 ATM (simple) Example Step 2 – Add column
Now is the time to fill in the T (TRUE) and F (FALSE) for the conditions. How do you do that? The simplest is to say that it should look like this: Conditions Rule1 Rule2 Rule3 Rule4 Withdrawal Amount <= Balance? T F Credit Granted? Action count 1 Withdrawal granted การทดสอบซอฟต์แวร์

45 ATM (simple) Example Step 3: Determine actions
Enter actions for each column in the table. You will be able to find this information in the requirement. Conditions Rule1 Rule2 Rule3 Rule4 Withdrawal Amount <= Balance? T F Credit Granted? Action count 1 Withdrawal granted การทดสอบซอฟต์แวร์

46 ATM (simple) Example Step 4 – Reduce the table
Mark insignificant values with “-”. If the requested amount is less than or equal to the account balance it does not matter if credit is granted. In the next step, you can delete the columns that have become identical. Conditions Rule1 Rule2 Rule3 Rule4 Withdrawal Amount <= Balance? T F Credit Granted? Action count 1 Withdrawal granted การทดสอบซอฟต์แวร์

47 ATM (simple) Example Step 4 – Reduce the table Conditions Rule1,2
Withdrawal Amount <= Balance? T F Credit Granted? - Action count 2 1 Withdrawal granted การทดสอบซอฟต์แวร์

48 ATM (simple) Example Step 5 – Write Test cases 1 200 2 100 Yes 3 No
Test Case ID Balance Withdrawal Amount Credit Granted Expected Results 1 200 2 100 Yes 3 No Withdrawal denied การทดสอบซอฟต์แวร์

49 Advantage of decision table technique:
Any complex business flow can be easily converted into the test scenarios & test cases using this technique. Such type of table are work iteratively, means the table created at the first iteration is used as input table for next tables. Such iteration can be carried out only if the initial table is unsatisfactory. Simple to understand and everyone can use this method design the test scenarios & test cases. It provide complete coverage of test cases which help to reduce the rework on writing test scenarios & test cases. These tables guarantee that we consider every possible combination of condition values. This is known as its “completeness property”. การทดสอบซอฟต์แวร์


Download ppt "Chapter 4: Decision Table Testing Software Testing"

Similar presentations


Ads by Google