45
Levels of Testing Chapter 12 Beyond unit testing

Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

Levels of Testing

Chapter 12

Beyond unit testing

Page 2: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–2

Life cycle models

What is a life cycle model of software development?

What is the traditional life cycle model?

Page 3: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–3

V-Model – development & testing

Requirements

DetailedDesign

Moduleimplementation Unit test

Integration test

System test

Acceptancetest

Run

testsW

rite tests

Customer

Developer

Functional

Structural

ArchitecturalDesign

Page 4: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–4

Traditional model

How well do the levels of the traditional Waterfall modelcorrelate with testing?

In what way?

Page 5: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–5

Traditional model – 2

How well do the levels of the traditional Waterfall modelcorrelate with testing?

In what way? Levels correlate with levels of testing

Functional testing is implied

Bottom up testing is implied

Page 6: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–6

Developer – unit testing stage

What is unit testing?

How do we do unit testing?

Page 7: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–7

What is unit testing?

How do we do unit testing?

Testing of individual components

Unit is best understood

Have both functional and structural testing

Developer – unit testing stage – 2

Page 8: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–8

Developer – integration testing stage

What is integration testing?

How do we do integration testing?

Page 9: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–9

What is integration testing?

How do we do integration testing? Testing to expose problems arising from the

combination of components Bottom up

Combine smaller units into larger ones, untilsystem level is reached

Developer – integration testing stage – 2

Page 10: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–10

Developer – system testing stage

What is system testing?

How do we do system testing?

Page 11: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–11

What is system testing?

How do we do system testing?

Testing the complete system prior to delivery

Functional testing

No good structural notation for descriptions

Developer – system testing stage – 2

Page 12: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–12

Acceptance testing stage

What is acceptance testing?

Who does it?

Page 13: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–13

What is acceptance testing?

Who does it?

Testing by clients / users to check that the systemsatisfies requirements

Sometimes called alpha testing

Acceptance testing stage – 2

Page 14: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

Basic development methods

What are the three basic methods that can be used todevelop a system?

LOT–14

Page 15: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–15

What are the three basic methods that can be used todevelop a system?

Top down

Bottom up

Big Bang

Basic development methods – 2

Page 16: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–16

Top-down development

How does top-down development work?

Page 17: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–17

Top-down development – 2

How does top-down development work?

Build upper level Test using stubs

Throw away Repeat with next lower level

Page 18: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–18

Bottom-up development

How does bottom-up development work?

Page 19: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–19

Bottom-up development – 2

How does bottom-up development work?

Build lower levels

Test with drivers Throw away Repeat with next higher level

Page 20: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–20

Big bang development

How does big-bang development work?

Page 21: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–21

Big bang development

How does big-bang development work?

Build everything

Then test

No stubs or drivers

Page 22: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–22

Problems with waterfall model

What are the problems with the waterfall model?

Page 23: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–23

Problems with waterfall model – 2

What are the problems with the waterfall model? Too slow Too rigid Too focused on top-down functional development and

bottom-up testing Not the way people work Staffing levels of different types batched at different

times with the levels requiring large resource shiftsfrom low to high and back.

Page 24: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–24

Waterfall spin-off models

Development in stages Level use of staff What types of testing is done?

Page 25: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–25

Waterfall spin-off models – 2

Development in stages Level use of staff What types of testing is done?

Testing now entails both

Regression

Progression

Page 26: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–26

Waterfall spin-off models – 3

What are the major types of spin off models?

Page 27: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–27

Waterfall spin-off models – 4

What are the major types of spin off models? Variations involve constructing a sequence of

systems Incremental

Evolutionary

Spiral

Page 28: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–28

Waterfall spin-off models – 5

What is their common modus operandi?

Page 29: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–29

Waterfall spin-off models – 6

What is their common modus operandi?

Waterfall model is applied to each build

Smaller problem than original

System functionality does not change during abuild

Page 30: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–30

Incremental model

Have high-level design at the beginning

Low-level design results in a series of builds Incremental testing is useful System testing is not affected

Level off staffing problems

Page 31: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–31

Evolutionary model

First build is defined

Priorities and customer define next build

Difficult to have initial high-level design Incremental testing is difficult System testing is not affected

Page 32: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–32

Spiral model

Combination of incremental and evolutionary

After each build assess benefits and risks Use to decide go/no-go and direction

Difficult to have initial high-level design Incremental testing is difficult System testing is not affected

Page 33: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–33

Spiral model – advantage

Earlier synthesis and deliverables

More customer feedback

Risk/benefit analysis is rigorous

Page 34: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–34

Rapid prototyping

Specification based life cycle model

Build quick and dirty system Good for risk analysis

Customer feedback

Page 35: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–35

Rapid prototyping – 2

System testing is difficult Where is the specification?

Good for acceptance testing Emphasis is behaviour, not structure

Page 36: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–36

Executable specifications

Specification based life cycle model

Extension of rapid prototyping

Specific behavioural models are built and executed Statecharts Finite state machines Petri nets Z specification language

Customer feedback as for rapid prototyping

Page 37: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–37

Integration & system testing

Need to know difference between integration and systemtesting Avoid gaps and redundancies across levels Set testing goals appropriate for each level

Structural & behavioural views separate integration andsystem testing goals

Page 38: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–38

Threads

What are threads?

Page 39: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–39

Threads – 2

What are threads? Use cases Describe behaviour

Have threads at different levels What are the levels?

Page 40: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–40

Thread levels

Have threads at different levels What are the levels?

Unit

Integration

System

Page 41: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–41

Thread levels – 2

What are the threads at each level? Unit

??? Integration

??? System

???

Page 42: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–42

Thread levels – 3

Unit Path in a program graph

Integration Path in a finite state machine

System level Data context and sequence of port events

Page 43: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–43

Structural insights – integration testing

Assumes unit level testing completed

Can be seen as interface testing What about algorithms at higher levels?

Uses preliminary design What is preliminary design?

Page 44: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–44

Structural insights – system testing

Requirements level

What is the difference between the following? Requirements Preliminary design

What-how and other definitions too vague Inevitability of intertwining specification and design

Page 45: Levels of TestingLOT–3 V-Model – development & testing Requirements Detailed Design Module implementation Unit test Integration test System test Acceptance test s s Customer LOT–5

LOT–45

Behavioural insights

System level Deals with port boundaries

What the user sees and does Sequences of integration-level threads

Integration level Deals with boundaries between port and unit

Within the system Sequences of unit-level threads