Boundary Value Testing Chapter 5 Introduction Input domain testing - - PowerPoint PPT Presentation

boundary value testing
SMART_READER_LITE
LIVE PREVIEW

Boundary Value Testing Chapter 5 Introduction Input domain testing - - PowerPoint PPT Presentation

Boundary Value Testing Chapter 5 Introduction Input domain testing is the most commonly taught (and perhaps the most commonly used) software testing technique There are a number of approaches to boundary value analysis We will study


slide-1
SLIDE 1

Boundary Value Testing

Chapter 5

slide-2
SLIDE 2

BVT–2

Introduction

 Input domain testing is the most commonly taught (and

perhaps the most commonly used) software testing technique

 There are a number of approaches to boundary value

analysis

 We will study some of the limitations of domain testing

slide-3
SLIDE 3

BVT–3

Program view for boundary analysis

 What is the view we take of a program for boundary

analysis?

slide-4
SLIDE 4

BVT–4

Program view for boundary analysis – 2

 Many programs can be viewed as a function F that

maps values from a set A (its domain) to values in another set B (its range)

 The input variables of F will have some (possibly

unstated) boundaries:

F(x1,x2) : A "B

a " x1 " b c " x 2 " d

slide-5
SLIDE 5

BVT–5

What is BVA?

 What is boundary analysis?

slide-6
SLIDE 6

BVT–6

What is BVA – 2

 For each variable, select five values

 Min

The minimum

 Min+

Slightly above the minimum

 Nom

Nominal

 Max–

Slightly below the maximum

 Max

Maximum

slide-7
SLIDE 7

BVT–7

Rational for BVA

 What is the rationale for BVA?

slide-8
SLIDE 8

BVT–8

Rational for BVA – 2

 What is the rationale for BVA?

 Errors occur at boundaries because people

 Mistake logical relations such as mixing < with ≤  Are off by one in counting

 Fence posts and rails

slide-9
SLIDE 9

BVT–9

Critical assumption

 What is the critical assumption made with boundary

value testing?

slide-10
SLIDE 10

BVT–10

Critical assumption

 What is the critical assumption made with boundary

value testing?

 Single Fault Assumption

 Failures are rarely the result of the simultaneous

  • ccurrence of two (or more) faults
slide-11
SLIDE 11

BVT–11

Single fault assumption

 Based on this assumption

 How are test cases selected when multiple

variables are involved?

slide-12
SLIDE 12

BVT–12

Single fault assumption – 2

 Generate test cases as such for all i

 Values of all but one variable xi at nominal  xi assumes the four non-nominal values from the slide

Boundary Analysis – 2

 One test case with all nominal values

 What are the number of test cases?

See Figure 5.2

slide-13
SLIDE 13

BVT–13

Single fault assumption – 3

 Generate test cases as such for all i

 Values of all but one variable xi at nominal  xi assumes the four non-nominal values from the slide

Boundary Analysis – 2

 One test case with all nominal values

 What are the number of test cases?

 #Variables * 4 + 1

See Figure 5.2

slide-14
SLIDE 14

BVT–14

Two-variable function test cases

<x1nom, x2min> <x1nom, x2min+> <x1nom, x2nom> <x1nom, x2max-> <x1nom, x2max> <x1min, x2nom> <x1min+, x2nom> <x1nom, x2nom> <x1max-, x2nom> <x1max, x2nom>

Apply BVA to the Triangle problem 1 ≤ a ≤ 200 1 ≤ b ≤ 200 1 ≤ c ≤ 200

Redundant tests

slide-15
SLIDE 15

BVT–15

Advantages

 When does boundary value analysis work well?

slide-16
SLIDE 16

BVT–16

Advantages – 2

 Independent variables

 Single fault assumption

 Physical quantities  Languages that are not strongly typed

 Why were strongly typed languages developed?

slide-17
SLIDE 17

BVT–17

Advantages – 3

 Independent variables

 Single fault assumption

 Physical quantities  Languages that are not strongly typed

 Why were strongly typed languages developed?

 To prevent errors easily found with BVA

slide-18
SLIDE 18

BVT–18

Limitations

 What are the limitations of boundary value analysis?

slide-19
SLIDE 19

BVT–19

Limitations – 2

 Does not work well for Boolean variables

 Why are these not suitable?

 Does not work well for logical variables

 PIN, transaction type  Why are these not suitable?

 When variables are not independent – i.e. are

dependent

 What example does the textbook give?

 Not that useful for strongly-typed languages

slide-20
SLIDE 20

BVT–20

Variations of boundary value analysis

 What extensions or variations are made for

boundary value analysis?

 What is the justification for each?

slide-21
SLIDE 21

BVT–21

Extensions

 Robustness testing  Worst case testing  Robust worst case testing  Special value testing  Random testing

slide-22
SLIDE 22

Robustness testing

 What is robustness testing?

BVT–22

slide-23
SLIDE 23

BVT–23

Robustness testing – 2

Add two more values per variable

Max+ Slightly greater than the maximum

Min– Slightly less than the minimum

What is the expected output?

Hopefully error message, system recovers

Implementing these test cases may not be possible

What is the difficulty? See Figure 5.3

slide-24
SLIDE 24

BVT–24

Robustness testing – 3

Add two more values per variable

Max+ Slightly greater than the maximum

Min– Slightly less than the minimum

What is the expected output?

Hopefully error message, system recovers

Implementing these test cases may not be possible

What is the difficulty?

 Determining the expected output for out of range

values

See Figure 5.3

slide-25
SLIDE 25

BVT–25

Robustness testing – 4

What are the number of test cases?

When is robust testing mandated?

slide-26
SLIDE 26

BVT–26

Robustness testing – 5

What are the number of test cases?

#variables * 6 + 1

When is robust testing mandated?

With exception handling

slide-27
SLIDE 27

Worst case testing

 What is worst case testing?

BVT–27

slide-28
SLIDE 28

BVT–28

Worst-Case Testing – 2

 Rejects the simple fault assumption and tests all

combinations of values

 Often leads to a large number of test cases with low

bug-finding power

 Why?

 What are the number of test cases?

See Figure 5.4

slide-29
SLIDE 29

BVT–29

Worst-Case Testing – 3

 Rejects the simple fault assumption and tests all

combinations of values

 Often leads to a large number of test cases with low

bug-finding power

 Why?

 Typically there are few bugs compared to the number

  • f tests

 What are the number of test cases?

 5 ^ #variables

See Figure 5.4

slide-30
SLIDE 30

BVT–30

Worst-Case Testing – 4

 What type of testing is better to do in place of worst

case testing?

slide-31
SLIDE 31

BVT–31

Worst-Case Testing – 5

 What type of testing is better to do in place of worst

case testing?

 Often better to use Special Value Testing

slide-32
SLIDE 32

Robust worst case testing

 What is robust worst case testing?

BVT–32

slide-33
SLIDE 33

BVT–33

Robust worst case testing – 2

 Add the values min– and max+ to the possible variable

values

 Now take all combinations of variable values  What are the number of test cases?

See Figure 5.5

slide-34
SLIDE 34

Special value testing

 What is special value testing?

BVT–34

slide-35
SLIDE 35

BVT–35

Special value testing – 2

 Use best engineering judgment

 Intuition  Domain knowledge  Experience  Soft spots

slide-36
SLIDE 36

BVT–36

In class activity

Do exercises 1, 2 and 3

slide-37
SLIDE 37

BVT–37

Random testing

 Select random values for each variable  How many tests do we make?

slide-38
SLIDE 38

BVT–38

Random testing – 2

 Select random values for each variable  How many tests do we make?

 Related to the probability of producing every outcome at

least once

 Related to the probability of executing every statement /

path at least once