Presentation is loading. Please wait.

Presentation is loading. Please wait.

Decision Table Based Testing Outline Decision table vocabulary –Limited Entry Decision Tables (LEDT) –Extended Entry Decision Tables (EEDT) –Mixed Entry.

Similar presentations


Presentation on theme: "Decision Table Based Testing Outline Decision table vocabulary –Limited Entry Decision Tables (LEDT) –Extended Entry Decision Tables (EEDT) –Mixed Entry."— Presentation transcript:

1 Decision Table Based Testing Outline Decision table vocabulary –Limited Entry Decision Tables (LEDT) –Extended Entry Decision Tables (EEDT) –Mixed Entry Decision Tables (MEDT) Techniques –Redundant LEDTs –Inconsistent LEDTs Examples Guidelines Cause and Effect Graphs

2 Decision Table Based Testing Decision table is based on logical relationships just as the truth table. Decision Table is a tool that helps us look at the combination of conditions –Completeness of conditions –Inconsistency of conditions

3 Decision Table Based Testing Originally known as Cause and Effect Graphing –Done with a graphical technique that expressed AND-OR-NOT logic. –Causes and Effects were graphed like circuit components –Inputs to a circuit “caused” outputs (effects) Equivalent to forming a decision table in which: –inputs are conditions –outputs are actions Test every (possible) rule in the decision table. Recommended for logically complex situations. Excellent example of Model-Based Testing (MBT)

4 Content of a Decision Table Conditions –binary in a Limited Entry Decision Table –finite set in an Extended Entry Decision Table –condition stub –condition entries Actions –also binary, either do or skip –the “impossible” action Rules –a rule consists of condition entries and action entries –a complete, non-redundant LEDT with n conditions has 2 n rules –logically impossible combinations of conditions are “impossible rules”, denoted by an entry in the impossible action

5 Components of a Decision Table C1 C2 C3 a1 a2 a3 a4 a5 T T T T F F F F T T F F T F T F x x x x x x x x x x “binary” conditions actions values of conditions actions taken R1 R2 R3 R4 R5 R6 R7 R8 rules Read a Decision Table by columns of rules : (e.g. R1 from reqs. or design says when all conditions are T, then actions a1, a2, and a5 should occur)

6 Example (continued) The condition entries in rules 3 and 4, and rules 7 and 8 have the same actions. The “—” means... –“Don’t Care” (as in circuit analysis), –Irrelevant, or –not applicable, n/a StubRule 1Rule 2 Rules 3, 4 Rule 5Rule 6 Rules 7, 8 c1TTTFFF c2TTFTTF c3TF—TFT a1XXX— a2XX a3X a4XXX

7 Example (continued) StubRule 1Rule 2 Rules 3, 4, 7, 8 Rule 5Rule 6 c1TT—FF c2TTFTT c3TF—TF a1XXX a2XX a3X a4XX count11411 Rule counting –a rule with no don’t care entries counts as 1 –each don’t care entry in a rule doubles the rule count –for a table with n limited entry conditions, the sum of the rule counts should be 2 n.

8 Problematic Decision Tables For LEDTs, simple rule counting helps identify decision tables that are... –incomplete ( rule count < 2 n ), –redundant ( rule count > 2 n ), or –inconsistent ( rule count > 2 n ) AND at least two rules have identical condition entries but different action entries. Redundancy and inconsistency are more likely with algebraically simplified tables that have been “maintained”.

9 A Redundant DT Rule 9 is redundant with Rules 1 – 4 (technically, with what was rule 4) But the action entries are identical (No harm, no foul?) conditions 1 – 456789 c1TFFFFT c2—TTFFF c3—TFTFF a1XXX——X a2—XXX—— a3X—XXXX

10 An Inconsistent DT Rule 9 is inconsistent with Rules 1 – 4 (technically, with what was rule 4) –condition portion is identical, BUT –action portion is different What happens when Rule 4 is executed? Rule 9? conditions 1 – 456789 c1TFFFFT c2—TTFFF c3—TFTFF a1XXX—— — a2—XXX— X a3X—XXX —

11 Month Equivalence Classes (to be used in the next example ) M1 ={x : x is a 30-day month} M2 ={x : x is a 31-day month} M3 ={x : x is February}

12 Last Day of Month Decision Table conditions12345678910111213141516 c1. M1? TTTTTTTTFFFFFFFF c2. M2? TTTTFFFFTTTTFFFF c3. M3? TTFFTTFFTTFFTTFF c4. leap year? TFTFTFTFTFTFTFTF a1. last day = 30 xx a2. last day = 31 xx a3. last day = 28 x a4. last day = 29 x a5. impossible xxxxxxxxxx Rule pairs 1 and 2, 3 and 4, 5 and 6, 9 and 10 don’t need c4, so they could be combined, BUT Impossible because c1, c2, and c3 are mutually exclusive.

13 Extended Entry Decision Tables When conditions are mutually exclusive, exactly one must be true. Extended entry decision tables typically (but not necessarily) have mutually exclusive conditions. The “extended” part is because a condition stub is an incomplete statement that is completed by the condition entry. (See the revised Last Day of Month EEDT)

14 Revised Last Day of Month DT When conditions are mutually exclusive, exactly one must be true. This can be further simplified. c1. 30-day month? M1 ———— c2. 31-day month? —— M2 —— c3. February? ———— M3 c4. leap year?TFTFTF a1. last day = 30xx a2. last day = 31xx a3. last day = 28x a4. last day = 29x

15 The “Emphatic False” Maybe “—” should be replaced by “must be False” One writer suggested “F!” (before “!” meant “NOT”) It is a Don’t Care in c4. Technically, this is a Mixed Entry Decision Table, because it has both extended and limited entry conditions. c1. month inM1——— c2. month in—M2—— c3. month in——M3 c4. leap year?——TF a1. last day = 30x a2. last day = 31x a3. last day = 28x a4. last day = 29x

16 c1: a, b, c form a triangle?FTTTTTTTT c2: a = b?—TTTTFFFF c3: a = c?—TTFFTTFF c4: b = c?—TFTFTFTF a1: Not a triangleX a2: ScaleneX a3: IsoscelesXXX a4: EquilateralX a5: ImpossibleXXX Triangle Program Decision Table Why are some rules impossible?

17 Expanding c1... c1: a<b+c?FTTTTTTTTTT c2: b<a+c?—FTTTTTTTTT c3: c<a+b?——FTTTTTTTT c4: a = b?———TTTTFFFF c5: a = c?———TTFFTTFF c6: b = c?———TFTFTFTF a1: Not a trianglexxx a2: Scalenex a3: Isoscelesxxx a4: Equilateralx a5: Impossiblexxx Is this a complete decision table? How many test cases does this imply?

18 Triangle Problem Example (“short” form) 1.a < b + c 2.b < a + c 3.c < a + b 4.a = b 5.a = c 6.b = c 1.Not triangle 1.Scalene 2.Isosceles 3.Equilateral 4.“impossible” F T T T T T T T T T T - F T T T T T T T T T - - F T T T T T T T T - - - T T T T F F F F - - - T T F F T T F F - - - T F T F T F T F X X X X X X X X X X X Note the Impossible cases Pick input set,, for each of the columns, or rules, below Assume a, b and c are all between 1 and 200 R1R2R3R4R5R7R6R9R8 R11R10 equivalent or all necessary Req or Design should NOT have these cases

19 Rule Counting c1: a<b+c?FTTTTTTTTTT c2: b<a+c?—FTTTTTTTTT c3: c<a+b?——FTTTTTTTT c4: a = b?———TTTTFFFF c5: a = c?———TTFFTTFF c6: b = c?———TFTFTFTF Rule count3216811111111 a1: Not a trianglexxx a2: Scalene x a3: Isosceles x xx a4: Equilateral x a5: Impossible xx x

20 Corresponding Test Cases Case IDabcExpected Output DT1412Not a Triangle DT2142Not a Triangle DT3124Not a Triangle DT4555Equilateral DT5???Impossible DT6???Impossible DT7223Isosceles DT8???Impossible DT9232Isosceles DT10322Isosceles DT11345Scalene

21 NextDate Decision Table (first half) 12345678910 c1: month inM1 M2 c2: day inD1D2D3D4D5D1D2D3D4D5 c3: year in—————————— a1: impossible X a2: increment dayXXX XXXX a3: reset day X X a4: increment month X X a5: reset month a6: increment year M1: 30 days months, M2: 31 days months, M3: Dec, M4: Feb D1: 1~27, D2: 28, D3: 29, D4: 30, D5: 31 Y1: leap year, Y2: common year

22 NextDate Decision Table (first half reduced) 1–3456–910 c1: month inM1 M2 c2: day inD1, D2, D3D4D5D1, D2, D3, D4D5 c3: year in————— a1: impossible X a2: increment dayX X a3: reset day X X a4: increment month X X a5: reset month a6: increment year

23 NextDate Decision Table (second half) 111213141516171819202122 c1: month inM3 M4 c2: day inD1D2D3D4D5D1D2 D3 D4D5 c3: year in——————Y1Y2Y1Y2—— a1: impossible XXX a2: increment dayXXXX XX a3: reset day X XX a4: increment month XX a5: reset month X a6: increment year X M1: 30 days months, M2: 31 days months, M3: Dec, M4: Feb D1: 1~27, D2: 28, D3: 29, D4: 30, D5: 31 Y1: leap year, Y2: common year

24 NextDate Decision Table (second half reduced) 11–1415161718192021, 22 c1: month inM3 M4 c2: day inD1, D2, D3, D4 D5D1D2 D3 D4, D5 c3: year in———Y1Y2Y1Y2— a1: impossible XX a2: increment dayX X a3: reset day XX XX a4: increment month XX a5: reset month X a6: increment year X

25 NextDate Test Cases Test CaseRule(s)MonthDayYearExpected Output 1 1– 341520014/16/2001 2 443020015/1/2001 3 54312001 Invalid Input Date 4 6–911520011/16/2001 5 1013120012/1/2001 6 11–141215200112/16/2001 7 15123120011/1/2002 8 1621520012/16/2001 9 1722820042/29/2004 10 1822820013/1/2001 11 1922920043/1/2004 12 202292001Invalid Input Date 13 21, 222302001Invalid Input Date

26 Advantages/Disadvantages of Decision Table Advantages: (check completeness & consistency) 1.Allow us to start with a “complete” view, with no consideration of dependence 2.Allow us to look at and consider “dependence,” “impossible,” and “not relevant” situations and eliminate some test cases. 3.Allow us to detect potential error in our Specifications Disadvantages: 1.Need to decide (or know) what conditions are relevant for testing - - - this may require Domain knowledge e.g. need to know leap year for “next date” problem in the book 2.Scaling up can be massive: 2 n rules for n conditions - - - that’s if the conditions are binary and gets worse if the values are more than binary


Download ppt "Decision Table Based Testing Outline Decision table vocabulary –Limited Entry Decision Tables (LEDT) –Extended Entry Decision Tables (EEDT) –Mixed Entry."

Similar presentations


Ads by Google