Software Testing Functional MCC Dataflow Testing CauseEffect Graphing

  • Slides: 20
Download presentation
Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing testing 17 1

Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing testing 17 1

Testing from Fall 04 u Test phases – Unit, Integration, System, Acceptance, Regression u

Testing from Fall 04 u Test phases – Unit, Integration, System, Acceptance, Regression u Structural testing – C 0, C 1, Boundary u Random testing – Operational profile u Test testing 17 plans 2

Functional Testing u Black Box testing u Deriving test cases from the requirements testing

Functional Testing u Black Box testing u Deriving test cases from the requirements testing 17 3

Example Problem - Pay Program u reads in hours and wages u hours must

Example Problem - Pay Program u reads in hours and wages u hours must be > 0 and < 80 u wages must be > 0 and < 100 u time and a half is paid for hours > 40 u output messages are – "wages in error" – "hours in error" – "no error" testing 17 4

pay example But plotting the domain is not always practical testing 17 5

pay example But plotting the domain is not always practical testing 17 5

Non-graphical functional testing u Build – – – a matrix every row is a

Non-graphical functional testing u Build – – – a matrix every row is a condition from the problem construct all the truth-table possibilities indicate the output for every column becomes a subdomain create a test for every column u Identify important boundaries – create 2 -on, 1 -off test for each important boundary testing 17 6

Solution condition 1 2 3 4 5 6 0< h T T T F

Solution condition 1 2 3 4 5 6 0< h T T T F T T h<80 T T F T T T 40< h F T T F x x 0<w T T T F w < 100 T T F T output n. e. hrs wag testing 17 7

TTYP Task u Build a test matrix for the triangle problem – Given 3

TTYP Task u Build a test matrix for the triangle problem – Given 3 inputs, interpret them as the lengths of the sides of a triangle – Output the type of triangle: » Scalene, isosceles, equilateral, not a triangle, bad inputs testing 17 8

Multiple Condition Coverage u For each decision – test case for true and test

Multiple Condition Coverage u For each decision – test case for true and test case for false – same as C 1 u For each complex (involves logical operators) decision – test case for each combination of T/F for each relational operator – A || B requires TT, TF, FT, FF – Lazy evaluation => TX, FT, FF testing 17 9

TTYP Task – MCC u Generate the test sets to achieve multiple condition coverage

TTYP Task – MCC u Generate the test sets to achieve multiple condition coverage for the “if a>=b+c || b>=a+c || c>=a+b” decision in the triangle problem testing 17 10

Data flow coverage u Def x is a node where x is defined (given

Data flow coverage u Def x is a node where x is defined (given a value) u Use x is a node where the value of x is used in an expression or a decision – C use is in a computation – P use is in a decision (predicate) u. A def-free path is a path from a definition to a use that does not include another definition of that variable. testing 17 11

dcu - from every def to a c-use u c-use (computation) u if a

dcu - from every def to a c-use u c-use (computation) u if a variable is defined in node A and there are computational uses in node B and D, the dcu coverages requires an def-free path segment of either ABC or ACD testing 17 12

dpu - from every def to a p-use u p-use (predicate) u if a

dpu - from every def to a p-use u p-use (predicate) u if a variable is defined in node A and it is used in a decision in C, the dpu coverage requires two def-free paths, one with segment of A. . . CD and one with A. . . CE testing 17 13

du - from every def to every use u if a variable is defined

du - from every def to every use u if a variable is defined in node A and there are computational uses in node B and D, the du coverage requires a def-free path from node A to node B and a def-free path from node A to node D testing 17 14

TTYP task u Generate test case sets for triangle problem – dpu – dcu

TTYP task u Generate test case sets for triangle problem – dpu – dcu – du testing 17 15

Cause-Effect Graphing u Identify the basic conditions: b 1, b 2 (aka causes, atomic

Cause-Effect Graphing u Identify the basic conditions: b 1, b 2 (aka causes, atomic conditions) u Identify the effects as boolean expressions of the conditions u Identify combinations of the boolean expressions testing 17 16

Classic Example - boiler u Boiler should shut down if – Water level is

Classic Example - boiler u Boiler should shut down if – Water level is below 20, 000 lb – Water level is above 120, 000 lb – Degraded mode and steam meter fails (Degraded mode if water pump has failed or pump monitor has failed) testing 17 17

Conditions for boiler u B 1 – water below 20, 000 lbs u B

Conditions for boiler u B 1 – water below 20, 000 lbs u B 2 – water above 120, 000 lbs u B 3 – water pump has failed u B 4 – pump monitor has failed u B 5 – steam meter has failed u E 1 – shut the boiler u E 1 = (B 1 or B 2 or (B 5 (B 3 or B 4)) testing 17 18

TTYP u Identify the basic conditions for the triangle problem u Identify the effects

TTYP u Identify the basic conditions for the triangle problem u Identify the effects (e. g. scalene) and their boolean conditions testing 17 19

Thursday, Apr 6 u OO testing – Pressman 372 -375, 410 -423 – SOS

Thursday, Apr 6 u OO testing – Pressman 372 -375, 410 -423 – SOS ch 13 u Pre. Lecture quiz – functional, mcc, data-flow, testing 17 20