114
OO Integration Testing Chapter 18

OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

OO Integration Testing

Chapter 18

Page 2: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–2

What assumption is made for integration testing?

Page 3: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–3

What assumption is made for integration testing? Assume unit level testing is complete

Page 4: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–4

What choices are there for unit testing?

Page 5: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–5

What choices are there for unit testing? For OO have two choices for unit

What are they?

Page 6: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–6

What choices are there for unit testing? For OO have two choices for unit

Method is a unit Class is a unit

Page 7: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–7

What does integration testing entail? If method is a unit?

???

Page 8: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–8

What does integration testing entail? If method is a unit?

Need to integrate within the class Why?

Page 9: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–9

What does integration testing entail? If method is a unit?

Need to integrate within the class Occurs with classes that have multiple designers /

implementers

Page 10: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–10

What does integration testing entail? If method is a unit?

Need to integrate within the class Does occur with classes that have multiple

designers / implementers What else?

Page 11: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–11

What does integration testing entail? If method is a unit?

Need to integrate within the class Does occur with classes that have multiple

designers / implementers Need to integrate classes

Page 12: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–12

What does integration testing entail? If class is a unit?

???

Page 13: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–13

What does integration testing entail? If class is a unit?

Need to un-flatten classes

Page 14: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–14

What does integration testing entail? If class is a unit?

Need to un-flatten classes What else?

Page 15: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–15

What does integration testing entail? If class is a unit?

Need to un-flatten classes Need to remove test methods

What else?

Page 16: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–16

What does integration testing entail? If class is a unit?

Need to un-flatten classes Need to remove test methods Need to integrate classes

Page 17: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–17

What considerations are there with integrationtesting?

Page 18: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–18

What considerations are there with integrationtesting? Static considerations

Page 19: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–19

What considerations are there with integrationtesting? Static considerations

What else?

Page 20: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–20

What considerations are there with integrationtesting? Static considerations Dynamic considerations

Page 21: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–21

What information do we need for staticconsiderations?

Page 22: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–22

What information do we need for staticconsiderations? Class definitions

Page 23: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–23

What information do we need for staticconsiderations? Class definitions

Where are they?

Page 24: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–24

What information do we need for staticconsiderations? Class definitions

Program text

Page 25: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–25

What information do we need for staticconsiderations? Class definitions

Program text What else?

Page 26: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–26

What information do we need for staticconsiderations? Class definitions

Program text Static model

Page 27: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–27

What information do we need for staticconsiderations? Class definitions

Program text Static model

Consists of what?

Page 28: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–28

What information do we need for staticconsiderations? Class definitions

Program text Static model

Inheritance and uses structure

Page 29: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–29

What tests do we base on static considerations?

Page 30: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–30

What tests do we base on static considerations? Address polymorphism statically

Page 31: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–31

What tests do we base on static considerations? Address polymorphism statically

What do we do?

Page 32: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–32

What tests do we base on static considerations? Address polymorphism statically

Select a test for each polymorphic context

Page 33: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–33

What information do we need for dynamicconsiderations? Dynamic view is more challenging

Page 34: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–34

What information do we need for staticconsiderations? Dynamic model

Page 35: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–35

What information do we need for staticconsiderations? Dynamic model

Consists of what?

Page 36: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–36

What information do we need for staticconsiderations? Dynamic model

Finite state machines – Petri nets

Page 37: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–37

What information do we need for staticconsiderations? Dynamic model

Finite state machines – Petri nets What else?

Page 38: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–38

What information do we need for staticconsiderations? Dynamic model

Finite state machines – Petri nets Class communication – message passing

Page 39: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–39

What information do we need for staticconsiderations? Dynamic model

Finite state machines – Petri nets Class communication – message passing

What else?

Page 40: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–40

What information do we need for staticconsiderations? Dynamic model

Finite state machines – Petri nets Class communication – message passing Use cases – scenarios

What else?

Page 41: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–41

What information do we need for staticconsiderations? Dynamic model

Finite state machines – Petri nets Class communication – message passing Use cases – scenarios

Statecharts – are not useful

Page 42: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–42

How do we show class communications?

Page 43: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–43

How do we show class communications? Collaboration diagrams

Page 44: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–44

How do we show class communications? Collaboration diagrams

What else?

Page 45: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–45

How do we show class communications? Collaboration diagrams Sequence diagrams

Page 46: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–46

What are collaboration diagrams?

Page 47: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–47

What are collaboration diagrams? Annotated call graphs – Figure 18.1

Page 48: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–48

What are collaboration diagrams? Annotated call graphs – Figure 18.1

What types of integration do they support?

Page 49: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–49

How do we show class communications? Collaboration diagrams

Annotated call graph – Figure 18.1 Supports

Pair-wise integration strategy Neighbourhood integration strategy

Page 50: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–50

What are sequence diagrams?

Page 51: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–51

What are sequence diagrams? Finite state machines with time axis – Figure 18.2

Page 52: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–52

What are sequence diagrams? Finite state machines with time axis – Figure 18.2

What are the states?

Page 53: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–53

What are sequence diagrams? Finite state machines with time axis – Figure 18.2

States Classes – regular grain Methods – fine grain

Page 54: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–54

What are sequence diagrams? Finite state machines with time axis – Figure 18.2

States Classes – regular grain Methods – fine grain

What are the transitions?

Page 55: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–55

What are sequence diagrams? Finite state machines with time axis – Figure 18.2

States Classes – regular grain Methods – fine grain

Transitions correspond to sending messages What are they analogous to?

Page 56: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–56

What are sequence diagrams? Finite state machines with time axis – Figure 18.2

States Classes – regular grain Methods – fine grain

Transitions correspond to sending messages Close analogy with MM-paths

Page 57: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–57

What types of integration strategies are there?

Page 58: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–58

What types of integration strategies are there? Pair-wise

Figure 13.6

Neighbourhood Figure 13.7

Page 59: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–59

What is the problem with pair-wise integration?

Page 60: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–60

What is the problem with pair-wise integration? Too much extra work with stubs and drivers

Page 61: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–61

What is the problem with neighbourhoodintegration?

Page 62: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–62

What is the problem with neighbourhoodintegration? Some neighbourhoods may include most classes

Some neighbourhoods may be only two classes

See Figure 18.1

Page 63: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–63

What is the problem with neighbourhoodintegration? Some neighbourhoods may include most classes Some neighbourhoods may be only two classes What do we do?

Page 64: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–64

What is the problem with neighbourhoodintegration? Some neighbourhoods may include most classes Some neighbourhoods may be only two classes What do we do?

Get a better definition

Page 65: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–65

What is a better definition than a neighbourhood?

Page 66: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–66

What is a better definition than a neighbourhood? Centers of a graph

Ultra-center

Page 67: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–67

What is a better definition than a neighbourhood? Centers of a graph

Ultra-center What properties does an ultra-center have?

Page 68: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–68

What is a better definition than a neighbourhood? Centers of a graph

Ultra-center Minimize maximum distance to other nodes Neighbourhood grows from an ultra-center Analogy with ripples from dropping an object into

water

Page 69: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–69

What is a better definition than a neighbourhood? Centers of a graph

Ultra-center Minimize maximum distance to other nodes Neighbourhood grows from an ultra-center Analogy with ripples from dropping an object into

water What are the advantages / disadvantages?

Page 70: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–70

What is a better definition than a neighbourhood? Centers of a graph

Ultra-center Minimize maximum distance to other nodes Neighbourhood grows from an ultra-center Analogy with ripples from dropping an object into

water What are the advantages / disadvantages?

Less stubs Less diagnostic precision

Page 71: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–71

What is an MM-path in OO?

Page 72: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–72

What is an MM-path in OO? A sequence of method executions linked by messages

Page 73: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–73

What is an MM-path in OO? A sequence of method executions linked by messages

How is an execution path constructed?

Page 74: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–74

What is an MM-path in OO? A sequence of method executions linked by messages

Start at any class by sending a message Keep going until message quiescence is reached End at return from original message

Page 75: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–75

What is an MM-path in OO? A sequence of method executions linked by messages

Start at any class by sending a message Keep going until message quiescence is reached

What is this? End at return from original message

Page 76: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–76

What is an MM-path in OO? A sequence of method executions linked by messages

Start at any class by sending a message Keep going until message quiescence is reached

At a class that does not send any messages End at return from original message

See Figures 18.3, 18.4, 18.5

Page 77: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–77

What is the highest integration level?

Page 78: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–78

What is the highest integration level? Classes that implement an atomic system function

Page 79: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–79

What is an atomic system function?

Page 80: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–80

What is an atomic system function? An MM-path

Stimulus / response pair of port-level events

Page 81: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–81

What is an atomic system function? An MM-path

Stimulus / response pair of port-level events What does it begin and end with?

Page 82: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–82

What is an atomic system function? An MM-path

Stimulus / response pair of port-level events Begins with an input port event

Event quiescence Ends with an output port event

Event quiescence

Page 83: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–83

What good are atomic system functions?

Page 84: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–84

What good are atomic system functions? Addresses event-driven nature of OO programs

At the boundary of integration and system testing

Page 85: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–85

Why do we use directed graphs?

Page 86: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–86

Why do we use directed graphs? Directed graph makes it possible to be analytical in

choosing test cases

Page 87: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–87

OO-calendar analysis

How many test cases are there?

Page 88: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–88

OO-calendar analysis

How many test cases are there? Cyclomatic complexity is 23

Page 89: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–89

OO-calendar analysis

How many test cases are there? Cyclomatic complexity is 23

Implies 23 basis paths to test Can we do better?

Page 90: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–90

OO-calendar analysis

How many test cases are there? Cyclomatic complexity is 23

Implies 23 basis paths to test

Lower bound could be 3 test cases

Page 91: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–91

OO-calendar analysis

How many test cases are there? Cyclomatic complexity is 23

Implies 23 basis paths to test

Lower bound could be 3 test cases What are they?

Page 92: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–92

OO-calendar analysis

How many test cases are there? Cyclomatic complexity is 23

Implies 23 basis paths to test

Lower bound could be 3 test cases Start at each of the three statements in routine

testIt

Page 93: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–93

OO-calendar analysis

How many test cases are there? Cyclomatic complexity is 23

Implies 23 basis paths to test

Lower bound could be 3 test cases Start at each of the three statements in routine

testIt What is the problem?

Page 94: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–94

OO-calendar analysis

How many test cases are there? Cyclomatic complexity is 23

Implies 23 basis paths to test

Lower bound could be 3 test cases Start at each of the three statements in routine

testIt What is the problem?

Depends upon choice of test cases, which could missleap year related cases

Page 95: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–95

OO-calendar analysis

Depends upon choice of test cases, which could missleap year related cases

What do we need to do?

Page 96: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–96

OO-calendar analysis

Depends upon choice of test cases, which could missleap year related cases

Need to cover every message

Page 97: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–97

OO-calendar analysis

Depends upon choice of test cases, which could missleap year related cases

Need to cover every message

What is a good way to do this?

Page 98: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–98

OO-calendar analysis

OO-calendar analysis Depends upon choice of test cases, which could miss

leap year related cases Need to cover every message What is a good way to do this?

The test cases identified in decision table testing(Table 7.16) would give a good integration testsuite

Look for test cases to cover every message inFigure 18.3

Page 99: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–99

Are MM-paths sufficient?

Page 100: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–100

Data flow testing

Are MM-paths sufficient? Like DD-paths, they are insufficient

Page 101: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–101

Data flow testing

Are MM-paths sufficient? Like DD-paths, they are insufficient

Why?

Page 102: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–102

Data flow testing

Are MM-paths sufficient? Like DD-paths, they are insufficient Data values add complexity

Page 103: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–103

Data flow testing

Are MM-paths sufficient? Like DD-paths, they are insufficient Data values add complexity

From where does the complexity come?

Page 104: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–104

Data flow testing

Are MM-paths sufficient? Like DD-paths, they are insufficient Data values add complexity

Come from inheritance Come from stages of message passing

Page 105: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–105

Data flow testing

Are MM-paths sufficient? Like DD-paths, they are insufficient Data values add complexity

Come from inheritance Come from stages of message passing

What else?

Page 106: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–106

Data flow testing

Are MM-paths sufficient? Like DD-paths, they are insufficient Data values add complexity

Come from inheritance Come from stages of message passing

Program graphs are basis but are too simple What do we need?

Page 107: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–107

Data flow testing

Are MM-paths sufficient? Like DD-paths, they are insufficient Data values add complexity

Come from inheritance Come from stages of message passing

Program graphs are basis but are too simple Need event and message driven Petri nets

Page 108: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–108

Event & Message driven Petri nets (EMDPN)

P – set of port events input output

D – set of data places

M – message send/return places Output for sender Input for receiver

Page 109: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–109

EMDPN – 2

T – set of transitions Represent a method execution path

In – set of edges to transitions (P ∪ D ∪ M) ↔ T

It is a relation between places and transitions If deterministic then it is a function from places to

transitions

Out – set of edges from transitions T ↔ (P ∪ D ∪ M)

Page 110: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–110

Message send/receive places

Capture notion of inter-object messages They are a sink of a method execution path in the

sending object They are a source to a method execution path in the

receiving object The return is a sink of a method execution path in the

receiving object The return is a source to a method execution path in

the sending object

See Figures 18.7

Page 111: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–111

DU-paths

Define / use paths Focus on connectivity Ignore types of nodes

Page 112: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–112

Inheritance-induced data flow

Begin with a data place

End with a data place

Data places alternate with isA transitions isA transitions are degenerate execution paths

Implement inheritance

See Figure 18.8

Page 113: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–113

Message-induced data flow

Set of transitions Start with defining transition

Variable is defined in the module execution path End with use transition

Variable is used in the module execution path

Can be definition clear or not definition clear

See Figure 18.9&

Section 18.3.3 for an example path

Page 114: OO Integration Testing - York University · OO-calendar analysis OO-calendar analysis Depends upon choice of test cases, which could miss leap year related cases Need to cover every

IOO–114

Slices

Useful if executable Difficult to do in OO environment

Can be used for desk checking for fault location