Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 4: Decision Table Testing 322235 Software Testing By Dr. Wararat Songpan (Rungworawut) Faculty of Computer Science, Department of Science, Khon.

Similar presentations


Presentation on theme: "Chapter 4: Decision Table Testing 322235 Software Testing By Dr. Wararat Songpan (Rungworawut) Faculty of Computer Science, Department of Science, Khon."— Presentation transcript:

1 Chapter 4: Decision Table Testing 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) การทดสอบซอฟต์แวร์ 2

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

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

5 Decision Table Testing: DT Log In Facebook example: 5 or PhoneFT PasswordFF Expected Results Error: Incorrect Error: Please Confirm Password

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

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

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 การทดสอบซอฟต์แวร์ 8

9 Decision Table Testing: DT Log In Facebook example: 9 ConditionsRule1Rule2Rule3Rule4 or PhoneFTFT PasswordFFTT Expected Results Error: Incorrect Error: Please Confirm Password Error: Incorrect Facebook Page is Processed Condition Entry Condition Stubs

10 Decision Table Testing: DT Log In Facebook example: 10 ConditionsRule1Rule2Rule3Rule4 or PhoneFTFT PasswordFFTT Expected Results Error: Incorrect Error: Please Confirm Password Error: Incorrect Facebook Page is Processed Action EntryAction Stubs

11 Decision Table Testing: DT Log In Facebook example: 11 ConditionRule1Rule2Rule3Rule4 or PhoneFTFT PasswordFFTT Expected Results Error: Incorrect Error: Please Confirm Password Error: Incorrect 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: 12 ConditionsRule1Rule2Rule3Rule4Rule5Rule6Rule7Rule8Rule9 or Phone Blank Invalid Valid PasswordBlankInvalidValidBlankInvalidValidBlankInvalidValid Expected Results Error: Incorrect Error: Please Confir m Passwor d Error: Incorrect Error: Incorrect Error: Incorrect Error: Incorrec t Error: Please Confirm Passwor d Error: Please Confirm Password - Show pageLogin 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: 13 ConditionsRule1Rule2Rule3Rule4Rule5Rule6Rule7Rule8 User Registered? FFFFTTTT No Outstanding fees? FFTTFFTT Under Borrow limit? FTFTFTFT 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: 14 ConditionRule1Rule2Rule3Rule4Rule5Rule6Rule7Rule8 User Registered? FFFFTTTT No Outstanding fees? FFTTFFTT Under Borrow limit? FTFTFTFT Borrow Book?No Yes

15 Decision Table Testing: DT Library example: 15 ConditionsRule1,2Rule3Rule4Rule5Rule6Rule7Rule8 User Registered? FFFTTTT No Outstanding fees? FTTFFTT Under Borrow limit? -FTFTFT Borrow Book?No Yes “-” or “?” means don’t care entry

16 Decision Table Testing: DT Library example: 16 ConditionsRule1,2Rule3Rule4Rule5Rule6Rule7Rule8 User Registered? FFFTTTT No Outstanding fees? FTTFFTT Under Borrow limit? -FTFTFT Borrow Book?No Yes

17 Decision Table Testing: DT Library example: 17 ConditionsRule1,2Rule3,4Rule5Rule6Rule7Rule8 User Registered?FFTTTT No Outstanding fees? FTFFTT Under Borrow limit? --FTFT Borrow Book?No Yes

18 Decision Table Testing: DT Library example: 18 ConditionsRule1,2Rule3,4Rule5Rule6Rule7Rule8 User Registered?FFTTTT No Outstanding fees? FTFFTT Under Borrow limit? --FTFT Borrow Book?No Yes

19 Decision Table Testing: DT Library example: 19 ConditionsRule1,2Rule3,4Rule5,6Rule7Rule8 User Registered?FFTTT No Outstanding fees? FTFTT Under Borrow limit? ---FT Borrow Book?No Yes

20 Decision Table Testing: DT Library example: 20 ConditionsRule1,2Rule3,4Rule5,6Rule7Rule8 User Registered?FFTTT No Outstanding fees? FTFTT Under Borrow limit? ---FT Borrow Book?No Yes

21 Decision Table Testing: DT Library example: 21 ConditionsRule1-4Rule5,6Rule7Rule8 User Registered?FTTT No Outstanding fees? -FTT Under Borrow limit? --FT 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. 22

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

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

25 Test case design from decision table Triangle Example: การทดสอบซอฟต์แวร์ 25 Test Case IDabcExpected Results DT1 412 Not a Triangle DT2 142 Not a Triangle DT3 124 Not a Triangle DT4 555 Equilateral DT5 ??? Impossible DT6 ??? Impossible DT7 223 Isosceles DT8 ??? Impossible DT9 232 Isosceles DT Isosceles DT Scalene

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

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

28 Expanded Version Conditions c1: month in M1? c2: month in M2? c3: month in M3? TTTTTT TTFTTF TFTTFT TFFTFFF TTTTTT TTFTTF FTTFTT FTFFTF TTTTTT TFTTFT FTTFTT FFTFFT Rule count a1: impossible a2: a3: การทดสอบซอฟต์แวร์ 28 =12 rule counts M1 = {month: 1=12}

29 Impossible Rules Conditions c1: month in M1? c2: month in M2? c3: month in M3? TTTTTT TTFTTF TFTTFT TFFTFFF FTTFTT FTFFTF TTTTTT FFTFFT Rule count a1: impossible a2: a3: xxxxx การทดสอบซอฟต์แวร์ 29 M1 = {month: 1=12}

30 Redundancy Rule in Decision Table การทดสอบซอฟต์แวร์ 30 Condition s Rule 1-4 ( ) Rule 5Rule 6Rule 7Rule 8Rule 9 c1 c2 c3 T--T-- FTTFTT FTFFTF FFTFFT FFFFFF TFFTFF a1 a2 a3 xxxx xxxx xxxxxx xxxxx 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} การทดสอบซอฟต์แวร์ 31

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 T T a1: impossible a2: next date การทดสอบซอฟต์แวร์ 32

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} การทดสอบซอฟต์แวร์ 33

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

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

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} การทดสอบซอฟต์แวร์ 36

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

38 3) Decision Table (the third try)(Cont.) การทดสอบซอฟต์แวร์ 38 Conditions c1: month in c2: day in c3: year in M3 D1 - M3 D2 - M3 D3 - M3 D4 - M3 D5 - M4 D1 - M4 D2 Y1 M4 D2 Y2 M4 D3 Y1 M4 D3 Y2 M4 D4 - M4 D5 - Rule count action a1: impossible a2: increment day a3: reset day a4: increment month a5: reset month a6: increment year XXXX XXXXXX XX XXXX XXXX XXX

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

40 Reduce redundancy rules การทดสอบซอฟต์แวร์ 40 Conditions c1: month in c2: day in c3: year in M3 D1, D2, D3, D4 - M3 D5 - M4 D1 - M4 D2 Y1 M4 D2 Y2 M4 D3 Y1 M4 D3 Y2 M4 D4, D5 - Rule count action a1: impossible a2: increment day a3: reset day a4: increment month a5: reset month a6: increment year X XXXXXX XX XXXX XXXX XX

41 Test Cases design Next date example: การทดสอบซอฟต์แวร์ 41 Test Case IDMonthDayYearExpected Results 1-3 April April 16, April May 1, April Impossible 6-9 January January 16, January February 1, December December 16, December January 1, February February 15, February February 29, February March 1, February March 1, February Impossible 21,22 February Impossible =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: การทดสอบซอฟต์แวร์ 42

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” การทดสอบซอฟต์แวร์ 43 Conditions Withdrawal Amount <= Balance? Credit Granted? Actions Withdrawal granted

44 ATM (simple) Example ConditionsRule1Rule2Rule3Rule4 Withdrawal Amount <= Balance? TTFF Credit Granted?TFTF Action count1111 Withdrawal granted การทดสอบซอฟต์แวร์ 44 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:

45 ATM (simple) Example ConditionsRule1Rule2Rule3Rule4 Withdrawal Amount <= Balance? TTFF Credit Granted?TFTF Action count1111 Withdrawal grantedTTTF การทดสอบซอฟต์แวร์ 45 Step 3: Determine actions Enter actions for each column in the table. You will be able to find this information in the requirement.

46 ATM (simple) Example ConditionsRule1Rule2Rule3Rule4 Withdrawal Amount <= Balance? TTFF Credit Granted?TFTF Action count1111 Withdrawal grantedTTTF การทดสอบซอฟต์แวร์ 46 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.

47 ATM (simple) Example ConditionsRule1,2Rule3Rule4 Withdrawal Amount <= Balance? TFF Credit Granted?-TF Action count211 Withdrawal grantedTFF การทดสอบซอฟต์แวร์ 47 Step 4 – Reduce the table

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

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” การทดสอบซอฟต์แวร์ 49


Download ppt "Chapter 4: Decision Table Testing 322235 Software Testing By Dr. Wararat Songpan (Rungworawut) Faculty of Computer Science, Department of Science, Khon."

Similar presentations


Ads by Google