OO Integration Testing Chapter 18 What assumption is made for - - PowerPoint PPT Presentation

oo integration testing chapter 18 what assumption is made
SMART_READER_LITE
LIVE PREVIEW

OO Integration Testing Chapter 18 What assumption is made for - - PowerPoint PPT Presentation

OO Integration Testing Chapter 18 What assumption is made for integration testing? IOO2 What assumption is made for integration testing? Assume unit level testing is complete IOO3 What choices are there for unit testing?


slide-1
SLIDE 1

OO Integration Testing Chapter 18

slide-2
SLIDE 2

IOO–2  What assumption is made for integration testing?

slide-3
SLIDE 3

IOO–3  What assumption is made for integration testing?

 Assume unit level testing is complete

slide-4
SLIDE 4

IOO–4  What choices are there for unit testing?

slide-5
SLIDE 5

IOO–5  What choices are there for unit testing?

 For OO have two choices for unit

 What are they?

slide-6
SLIDE 6

IOO–6  What choices are there for unit testing?

 For OO have two choices for unit

 Method is a unit  Class is a unit

slide-7
SLIDE 7

IOO–7  What does integration testing entail?

 If method is a unit?

 ???

slide-8
SLIDE 8

IOO–8  What does integration testing entail?

 If method is a unit?

 Need to integrate within the class

 Why?

slide-9
SLIDE 9

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

slide-10
SLIDE 10

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?

slide-11
SLIDE 11

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

slide-12
SLIDE 12

IOO–12  What does integration testing entail?

 If class is a unit?

 ???

slide-13
SLIDE 13

IOO–13  What does integration testing entail?

 If class is a unit?

 Need to un-flatten classes

slide-14
SLIDE 14

IOO–14  What does integration testing entail?

 If class is a unit?

 Need to un-flatten classes

 What else?

slide-15
SLIDE 15

IOO–15  What does integration testing entail?

 If class is a unit?

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

 What else?

slide-16
SLIDE 16

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

slide-17
SLIDE 17

IOO–17  What considerations are there with integration

testing?

slide-18
SLIDE 18

IOO–18  What considerations are there with integration

testing?

 Static considerations

slide-19
SLIDE 19

IOO–19  What considerations are there with integration

testing?

 Static considerations

 What else?

slide-20
SLIDE 20

IOO–20  What considerations are there with integration

testing?

 Static considerations  Dynamic considerations

slide-21
SLIDE 21

IOO–21  What information do we need for static

considerations?

slide-22
SLIDE 22

IOO–22  What information do we need for static

considerations?

 Class definitions

slide-23
SLIDE 23

IOO–23  What information do we need for static

considerations?

 Class definitions

 Where are they?

slide-24
SLIDE 24

IOO–24  What information do we need for static

considerations?

 Class definitions

 Program text

slide-25
SLIDE 25

IOO–25  What information do we need for static

considerations?

 Class definitions

 Program text

 What else?

slide-26
SLIDE 26

IOO–26  What information do we need for static

considerations?

 Class definitions

 Program text

 Static model

slide-27
SLIDE 27

IOO–27  What information do we need for static

considerations?

 Class definitions

 Program text

 Static model

 Consists of what?

slide-28
SLIDE 28

IOO–28  What information do we need for static

considerations?

 Class definitions

 Program text

 Static model

 Inheritance and uses structure

slide-29
SLIDE 29

IOO–29  What tests do we base on static considerations?

slide-30
SLIDE 30

IOO–30  What tests do we base on static considerations?

 Address polymorphism statically

slide-31
SLIDE 31

IOO–31  What tests do we base on static considerations?

 Address polymorphism statically

 What do we do?

slide-32
SLIDE 32

IOO–32  What tests do we base on static considerations?

 Address polymorphism statically

 Select a test for each polymorphic context

slide-33
SLIDE 33

IOO–33  What information do we need for dynamic

considerations?

 Dynamic view is more challenging

slide-34
SLIDE 34

IOO–34  What information do we need for static

considerations?

 Dynamic model

slide-35
SLIDE 35

IOO–35  What information do we need for static

considerations?

 Dynamic model

 Consists of what?

slide-36
SLIDE 36

IOO–36  What information do we need for static

considerations?

 Dynamic model

 Finite state machines – Petri nets

slide-37
SLIDE 37

IOO–37  What information do we need for static

considerations?

 Dynamic model

 Finite state machines – Petri nets

 What else?

slide-38
SLIDE 38

IOO–38  What information do we need for static

considerations?

 Dynamic model

 Finite state machines – Petri nets  Class communication – message passing

slide-39
SLIDE 39

IOO–39  What information do we need for static

considerations?

 Dynamic model

 Finite state machines – Petri nets  Class communication – message passing

 What else?

slide-40
SLIDE 40

IOO–40  What information do we need for static

considerations?

 Dynamic model

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

 What else?

slide-41
SLIDE 41

IOO–41  What information do we need for static

considerations?

 Dynamic model

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

 Statecharts – are not useful

slide-42
SLIDE 42

IOO–42  How do we show class communications?

slide-43
SLIDE 43

IOO–43  How do we show class communications?

 Collaboration diagrams

slide-44
SLIDE 44

IOO–44  How do we show class communications?

 Collaboration diagrams

 What else?

slide-45
SLIDE 45

IOO–45  How do we show class communications?

 Collaboration diagrams  Sequence diagrams

slide-46
SLIDE 46

IOO–46  What are collaboration diagrams?

slide-47
SLIDE 47

IOO–47  What are collaboration diagrams?

 Annotated call graphs – Figure 18.1

slide-48
SLIDE 48

IOO–48  What are collaboration diagrams?

 Annotated call graphs – Figure 18.1

 What types of integration do they support?

slide-49
SLIDE 49

IOO–49  How do we show class communications?

 Collaboration diagrams

 Annotated call graph – Figure 18.1

 Supports

 Pair-wise integration strategy  Neighbourhood integration strategy

slide-50
SLIDE 50

IOO–50  What are sequence diagrams?

slide-51
SLIDE 51

IOO–51  What are sequence diagrams?

 Finite state machines with time axis – Figure 18.2

slide-52
SLIDE 52

IOO–52  What are sequence diagrams?

 Finite state machines with time axis – Figure 18.2

 What are the states?

slide-53
SLIDE 53

IOO–53  What are sequence diagrams?

 Finite state machines with time axis – Figure 18.2

 States

 Classes – regular grain  Methods – fine grain

slide-54
SLIDE 54

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?

slide-55
SLIDE 55

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?

slide-56
SLIDE 56

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

slide-57
SLIDE 57

IOO–57  What types of integration strategies are there?

slide-58
SLIDE 58

IOO–58  What types of integration strategies are there?

 Pair-wise  Figure 13.6  Neighbourhood  Figure 13.7

slide-59
SLIDE 59

IOO–59  What is the problem with pair-wise integration?

slide-60
SLIDE 60

IOO–60  What is the problem with pair-wise integration?

 Too much extra work with stubs and drivers

slide-61
SLIDE 61

IOO–61  What is the problem with neighbourhood

integration?

slide-62
SLIDE 62

IOO–62  What is the problem with neighbourhood

integration?

 Some neighbourhoods may include most classes  Some neighbourhoods may be only two classes

See Figure 18.1

slide-63
SLIDE 63

IOO–63  What is the problem with neighbourhood

integration?

 Some neighbourhoods may include most classes  Some neighbourhoods may be only two classes  What do we do?

slide-64
SLIDE 64

IOO–64  What is the problem with neighbourhood

integration?

 Some neighbourhoods may include most classes  Some neighbourhoods may be only two classes  What do we do?

 Get a better definition

slide-65
SLIDE 65

IOO–65  What is a better definition than a neighbourhood?

slide-66
SLIDE 66

IOO–66  What is a better definition than a neighbourhood?

 Centers of a graph

 Ultra-center

slide-67
SLIDE 67

IOO–67  What is a better definition than a neighbourhood?

 Centers of a graph

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

slide-68
SLIDE 68

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

slide-69
SLIDE 69

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?

slide-70
SLIDE 70

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

slide-71
SLIDE 71

IOO–71  What is an MM-path in OO?

slide-72
SLIDE 72

IOO–72  What is an MM-path in OO?

 A sequence of method executions linked by messages

slide-73
SLIDE 73

IOO–73  What is an MM-path in OO?

 A sequence of method executions linked by messages

 How is an execution path constructed?

slide-74
SLIDE 74

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

slide-75
SLIDE 75

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

slide-76
SLIDE 76

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

slide-77
SLIDE 77

IOO–77  What is the highest integration level?

slide-78
SLIDE 78

IOO–78  What is the highest integration level?

 Classes that implement an atomic system function

slide-79
SLIDE 79

IOO–79  What is an atomic system function?

slide-80
SLIDE 80

IOO–80  What is an atomic system function?

 An MM-path

 Stimulus / response pair of port-level events

slide-81
SLIDE 81

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?

slide-82
SLIDE 82

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

slide-83
SLIDE 83

IOO–83  What good are atomic system functions?

slide-84
SLIDE 84

IOO–84  What good are atomic system functions?

 Addresses event-driven nature of OO programs  At the boundary of integration and system testing

slide-85
SLIDE 85

IOO–85  Why do we use directed graphs?

slide-86
SLIDE 86

IOO–86  Why do we use directed graphs?

 Directed graph makes it possible to be analytical in

choosing test cases

slide-87
SLIDE 87

IOO–87  OO-calendar analysis  How many test cases are there?

slide-88
SLIDE 88

IOO–88  OO-calendar analysis  How many test cases are there?

 Cyclomatic complexity is 23

slide-89
SLIDE 89

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?

slide-90
SLIDE 90

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

slide-91
SLIDE 91

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?

slide-92
SLIDE 92

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

slide-93
SLIDE 93

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?

slide-94
SLIDE 94

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 miss

leap year related cases

slide-95
SLIDE 95

IOO–95  OO-calendar analysis

 Depends upon choice of test cases, which could miss

leap year related cases

 What do we need to do?

slide-96
SLIDE 96

IOO–96  OO-calendar analysis

 Depends upon choice of test cases, which could miss

leap year related cases

 Need to cover every message

slide-97
SLIDE 97

IOO–97  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?

slide-98
SLIDE 98

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 test suite

 Look for test cases to cover every message in

Figure 18.3

slide-99
SLIDE 99

IOO–99  Are MM-paths sufficient?

slide-100
SLIDE 100

IOO–100

Data flow testing

 Are MM-paths sufficient?

 Like DD-paths, they are insufficient

slide-101
SLIDE 101

IOO–101

Data flow testing

 Are MM-paths sufficient?

 Like DD-paths, they are insufficient

 Why?

slide-102
SLIDE 102

IOO–102

Data flow testing

 Are MM-paths sufficient?

 Like DD-paths, they are insufficient  Data values add complexity

slide-103
SLIDE 103

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?

slide-104
SLIDE 104

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

slide-105
SLIDE 105

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?

slide-106
SLIDE 106

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?

slide-107
SLIDE 107

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

slide-108
SLIDE 108

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

slide-109
SLIDE 109

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)

slide-110
SLIDE 110

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

slide-111
SLIDE 111

IOO–111

DU-paths

 Define / use paths

 Focus on connectivity  Ignore types of nodes

slide-112
SLIDE 112

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

slide-113
SLIDE 113

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

slide-114
SLIDE 114

IOO–114

Slices

 Useful if executable

 Difficult to do in OO environment

 Can be used for desk checking for fault location