20
1 testing17 Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing

1 testing17 Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing

Embed Size (px)

Citation preview

Page 1: 1 testing17 Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing

1testing17

Software Testing

Functional, MCC, Dataflow Testing,

Cause-Effect Graphing

Page 2: 1 testing17 Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing

2testing17

Testing from Fall 04 Test phases

– Unit, Integration, System, Acceptance, Regression

Structural testing– C0, C1, Boundary

Random testing– Operational profile

Test plans

Page 3: 1 testing17 Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing

3testing17

Functional Testing

Black Box testing Deriving test cases from the requirements

Page 4: 1 testing17 Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing

4testing17

Example Problem - Pay Program reads in hours and wages hours must be > 0 and < 80 wages must be > 0 and < 100 time and a half is paid for hours > 40 output messages are

– "wages in error"

– "hours in error"

– "no error"

Page 5: 1 testing17 Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing

5testing17

pay example

time

wages I II IIIIV

V

VI

? ?

? ?

0,0

But plotting the domain is not always practical

Page 6: 1 testing17 Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing

6testing17

Non-graphical functional testing Build a matrix

– every row is a condition from the problem

– construct all the truth-table possibilities

– indicate the output for every column

– every column becomes a subdomain

– create a test for every column

Identify important boundaries– create 2-on, 1-off test for each important boundary

Page 7: 1 testing17 Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing

7testing17

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 T T F

w < 100 T T T T F T

output n.e. n.e. hrs hrs wag wag

Solution

Page 8: 1 testing17 Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing

8testing17

TTYP Task

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

Page 9: 1 testing17 Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing

9testing17

Multiple Condition Coverage

For each decision– test case for true and test case for false

– same as C1

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

Page 10: 1 testing17 Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing

10testing17

TTYP Task – MCC

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

Page 11: 1 testing17 Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing

11testing17

Data flow coverage

Def x is a node where x is defined (given a value) 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)

A def-free path is a path from a definition to a use that does not include another definition of that variable.

Page 12: 1 testing17 Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing

12testing17

dcu - from every def to a c-useA

B

C

D

E

c-use (computation) 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

Page 13: 1 testing17 Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing

13testing17

dpu - from every def to a p-useA

B

C

D

E

p-use (predicate) 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

Page 14: 1 testing17 Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing

14testing17

du - from every def to every use

A

B

C

D

E

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

Page 15: 1 testing17 Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing

15testing17

TTYP task

Generate test case sets for triangle problem– dpu– dcu– du

Page 16: 1 testing17 Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing

16testing17

Cause-Effect Graphing

Identify the basic conditions: b1, b2 (aka causes, atomic conditions)

Identify the effects as boolean expressions of the conditions

Identify combinations of the boolean expressions

Page 17: 1 testing17 Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing

17testing17

Classic Example - boiler

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)

Page 18: 1 testing17 Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing

18testing17

Conditions for boiler

B1 – water below 20,000 lbs B2 – water above 120,000 lbs B3 – water pump has failed B4 – pump monitor has failed B5 – steam meter has failed E1 – shut the boiler E1 = (B1 or B2 or (B5 (B3 or B4))

Page 19: 1 testing17 Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing

19testing17

TTYP

Identify the basic conditions for the triangle problem

Identify the effects (e.g. scalene) and their boolean conditions

Page 20: 1 testing17 Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing

20testing17

Thursday, Apr 6

OO testing – Pressman 372-375,410-423– SOS ch 13

PreLecture quiz– functional, mcc, data-flow,