Software Testing Dataflow Testing, Object-Oriented testing19 1

16 Slides106.50 KB

Software Testing Dataflow Testing, Object-Oriented testing19 1

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. testing19 2

dcu - from every def to a c-use 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 testing19 A B C D E 3

dpu - from every def to a p-use 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 testing19 A B C D E 4

du - from every def to every use 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 testing19 A B C D E 5

TTYP task Generate test case sets for triangle problem – dpu – dcu – du testing19 6

Object-oriented Software Testing Object-oriented testing Pressman pp 372-375,410-423 SOS ch 13 testing19 7

Quotes “It seems likely that more, not less testing will be needed to obtain high reliability in object-oriented systems” Binder (in Pressman) testing19 8

Inheritance When do we need to retest the base class? – When can we assume that the base class has already been tested? testing19 9

Dynamic Binding When do we have to be concerned with dynamic bindings? – virtual functions testing19 10

Concerns about OO Testing Functional testing seems just as relevant to oo software as to traditional software Random and operational testing seem relevant to oo software Structural testing, C0 and C1, doesn’t seem effective for oo software, except . testing19 11

Coverage of functions Every function should be called at least once Overloaded functions need to have every version executed testing19 12

Coverage of function calls Every MM pair (Method-message) should be executed. – that is, every call to a method from a method should be executed – if a function has more than one call to another method, all calls need to executed testing19 13

Coverage of States An alternative view of testing is based on the states of a process Testing coverage can be – – – – testing19 every state every transition every pair of transitions etc. 14

Data Flow coverage Can we apply data flow coverage to object oriented software Def’s are often in one method, use in another testing19 15

Schedule Thurs, Apr 13 – Reliability - SOS 10.3 - 10.3.3 – PLQ Tues, Apr 18 – Finish reliability, SQA task Thurs, Apr 20 – Make-up exam for OCL testing19 16

Back to top button