32
Randall Rice, Rice Consulting Services Defect Sampling – An Innovation for Focused Testing www.eurostarconferences.com @esconfs #esconfs

Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

Embed Size (px)

DESCRIPTION

EuroSTAR Software Testing Conference 2012 presentation on focusing testing for bigger dividends

Citation preview

Page 1: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

Randall Rice, Rice Consulting Services

Defect Sampling – An Innovation for

Focused Testing

www.eurostarconferences.com

@esconfs #esconfs

Page 2: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

DEFECT SAMPLING – AN

INNOVATION FOR

FOCUSED TESTING

RANDALL W. RICE, CTAL

RICE CONSULTING SERVICES, USA

WWW.RICECONSULTING.COM

© 2012, Rice Consulting Services, Inc.

Page 3: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

3

THE BIG IDEA

• As testers, our job is to find defects.

• However, we often look for only the

symptoms of defects – failures.

• All testing is sampling

• What if…

• We had ways to sample for defects?

• Defects really do cluster?

• We could predict where best to look for

defects?

• We looked for defects differently?

Page 4: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

4

THE BAD NEWS

• As testers, we suffer from the “needle

in a haystack” problem.

• Looking for something very small in

something very large.

• However, a metal detector helps!

Page 5: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

5

A GOLD MINING

ANALOGY

• Gold mining is an expensive task, even on a small scale.

• Testing can also be expensive.

• There are often places that look promising for gold.

• But there is no way to tell from the surface if gold is really underground.

• The only way to know for sure is to drill holes and sample the dirt.

• In testing, we can do something similar as a way to test our intuition and suspicions about where defects may be.

• Test automation is a creative way to drill for defects.

Page 6: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

6

NO HELPFUL SIGNS!

Page 7: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

7

WHAT DO WE SEEK?

Failures

Defects

Externally Visible Through Functional (Black-box) Testing

Internally Visible Through Structural (White-

box) Testing and Static Analysis

Page 8: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

8

THE PROBLEM

• External

• Too much to cover, too little time

• Unclear expected behavior

• Test automation mainly used for

confirmatory testing

• Internal

• Lack of technical knowledge by testers

• Lack of motivation from developers

• Lots of code!

• Many interactions

• However, there are some very helpful

static test tools

Page 9: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

9

THE CONCEPT

Sample 1 Sample 2

Sample 3 Sample 4

Sample 5 Sample 6

Defect

Defect

Visible Feature Sets

Above the surface we use a lot of

guesswork.

Below the surface is

where the defects are.

Failure

Failure

Page 10: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

10

ADJUSTING THE

SAMPLES (TESTS)

Sample 7 Sample 2

Sample 8

Sample 9 Sample 5

Sample 10

Defect

Defect

Defect Defect

Visible Feature Sets

When we find a

defect, there may be

others nearby.

Page 11: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

11

LOOKING BELOW THE

SURFACE

Sample 7 Sample 2

Sample 8

Sample 9 Sample 5

Sample 10

Defect

Defect

Defect Defect

Visible Feature Sets

Failure

Failure Failure

Failure Failure

Page 12: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

12

PATTERNS TELL US

SOMETHING

Variation Consistency

Sights are

probably OK, but

we need to work

on accuracy

Sights are off, but

we are consistent

in our aim.

Other variables could have

an impact: Wind, distance,

etc.

Page 13: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

13

THE KEY – LOOK FOR

PATTERNS

• Patterns help us find interesting defects.

• Commonality

• Concentration

• Contrast

• Types

• Trends

Pearson's correlation

Page 14: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

14

HOW CAN WE

SAMPLE?

• Classes

• Risk

• Relationships

• Statistical Methods

• Randomly

Page 15: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

15

CLASSES – SAMPLE 1

Input Types

Process

Types

Output Types

Defect Types

Input

Values

Output

Values

? States

Transient

Data Values

Page 16: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

16

CLASSES – SAMPLE 2

Input Types

Process

Types

Output Types

Defect Types

Input

Values

Output

Values

? States

Transient

Data Values

Page 17: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

17

RISK LEVELS –

SAMPLE 1

Very High

High

Moderate

Low

Likelihood

Impa

ct

High

Hig

h

Low

Low

Page 18: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

18

RISK LEVELS –

SAMPLE 2

Very High

High

Moderate

Low

Likelihood

Impa

ct

High

Hig

h

Low

Low

Page 19: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

19

RELATIONSHIPS

Is it possible to withdraw money from a closed

account with a positive balance?

Page 20: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

20

STATISTICAL SAMPLING

• Population analysis

• Used to model test data based on production data.

20% 20% 60%

0 – $1,000 $1,000 - $1,500 > $1,500

Value of annual customer orders

20% of

accounts < $1,000

20% of

accounts > $1,500

60% of accounts between

$1,000 and $1,500, inclusive

Page 21: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

21

TEST DATA MODELING

20% 20% 60%

0 – $1,000 $1,000 - $1,500 > $1,500

Value of annual customer orders

20% of

accounts < $1,000

20% of

accounts > $1,500

60% of accounts between

$1,000 and $1,500, inclusive

20% of test

accounts have

balances less than

$1,000.

60% of test accounts

have balances between

$1,000 and $1,500,

inclusive.

20% of test accounts

have balances greater

than $1,500.

Page 22: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

22

RANDOM SAMPLING

• Not a substitute for other approaches

• However, it can be helpful at times to help get off the

beaten path.

• Examples:

• The first n rows of data

• Every nth occurrence

• Random number generators

Page 23: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

23

HOW CAN WE

LEVERAGE THIS?

• Test Automation

• Frameworks to vary inputs and actions:

• Randomly

• Based on defect patterns and clustering

Page 24: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

24

EXAMPLE

• There are 10,000,000 possible values for a field variable to

be tested.

1. Extract or build test data based on the values to test and

the randomizing formula chosen.

2. Create automated tests using the data as input.

3. If a failure is seen, capture the test values and test a lower

to higher range.

Page 25: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

25

EXAMPLE (2)

0 10,000,000

Failure

5,001,004

✔ ✔ ✔ ✔

5,001,004 4,999,999 5,010,000

Failure

Range

Page 26: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

26

THE MISSING LINK –

FEEDBACK FROM MISSED

DEFECTS

Page 27: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

27

ENDING THE CYCLE

OF DEFECTS

• Defects = Rework = Lost $$

• The cycle continues until broken

Find Fix

Same types of defects

Create

Same types of defects

Page 28: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

28

THE FEEDBACK LOOP

Find Fix Create

Identify root causes and fix the process

New types of defects New types of defects

Page 29: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

29

USING DEFECT FEEDBACK

FOR TEST DESIGN

Find Fix Create

Identify root causes and fix the process

New types of defects New types of defects

New tests

Page 30: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

30

SUMMARY

• Failures are only symptoms of defects.

• Not every defect manifests a failure.

• Not all failures are defects.

• Before spending valuable time designing

and performing non-productive tests,

intelligent test sampling is a good way to

focus your efforts.

• No drill, no dig!

Page 31: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

31

BIO - RANDALL W. RICE

• Over 35 years experience in building and testing information systems in a variety of industries and technical environments

• ASTQB Certified Tester – Foundation level, Advanced level (Full)

• Director, American Software Testing Qualification Board (ASTQB)

• Chairperson, 1995 - 2000 QAI’s annual software testing conference

• Co-author with William E. Perry, Surviving the Top Ten Challenges of Software Testing and Testing Dirty Systems

• Principal Consultant and Trainer, Rice Consulting Services, Inc.

Page 32: Randy Rice - Defect Sampling – An Innovation for Focused Testing - EuroSTAR 2012

32

CONTACT INFORMATION

Randall W. Rice, CTAL

Rice Consulting Services, Inc.

P.O. Box 892003

Oklahoma City, OK 73170

Ph: 405-691-8075

Fax: 405-691-1441

Web site: www.riceconsulting.com

e-mail: [email protected]