The Practical Assessment of Test Sets with Inductive Inference - - PowerPoint PPT Presentation

the practical assessment of test sets with inductive
SMART_READER_LITE
LIVE PREVIEW

The Practical Assessment of Test Sets with Inductive Inference - - PowerPoint PPT Presentation

The Practical Assessment of Test Sets with Inductive Inference Techniques Neil Walkinshaw Department of Computer Science University of Leicester September 4, 2010 B ACKGROUND Test Adequacy Assessing the ability of a test set to identify


slide-1
SLIDE 1

The Practical Assessment of Test Sets with Inductive Inference Techniques

Neil Walkinshaw

Department of Computer Science University of Leicester

September 4, 2010

slide-2
SLIDE 2

BACKGROUND

Test Adequacy

◮ Assessing the ability of a test set to identify faults

◮ Successful execution of an adequate test set should imply

that there are no faults in a tested program

◮ How do you know if a test set is adequate? ◮ Numerous adequacy criteria have been developed

◮ Statement / branch / path / data-flow, . . .

slide-3
SLIDE 3

BACKGROUND

Test Adequacy

◮ Assessing the ability of a test set to identify faults

◮ Successful execution of an adequate test set should imply

that there are no faults in a tested program

◮ How do you know if a test set is adequate? ◮ Numerous adequacy criteria have been developed

◮ Statement / branch / path / data-flow, . . .

Problem

◮ Criteria based on syntax are often a poor approximation

for actual adequacy

slide-4
SLIDE 4

USING INFERENCE TO ASSESS TEST SET ADEQUACY

T est input generator

Program inputs

System under test

slide-5
SLIDE 5

USING INFERENCE TO ASSESS TEST SET ADEQUACY

T est input generator

Program inputs

System under test Inference engine

Observations of test executions

slide-6
SLIDE 6

USING INFERENCE TO ASSESS TEST SET ADEQUACY

T est input generator

Program inputs

System under test Inference engine

Observations of test executions

Hypothesis

slide-7
SLIDE 7

USING INFERENCE TO ASSESS TEST SET ADEQUACY

T est input generator

Program inputs

System under test Inference engine

Observations of test executions Equivalence implies test set adequacy

Hypothesis

slide-8
SLIDE 8

USING INFERENCE TO ASSESS TEST SET ADEQUACY

T est input generator

Program inputs

System under test Inference engine

Observations of test executions Equivalence implies test set adequacy

Hypothesis

Rationale: Only a sufficiently thorough test set will provide an adequate basis to infer an exact hypothesis.

slide-9
SLIDE 9

USING INFERENCE TO ASSESS TEST SET ADEQUACY

T est input generator

Program inputs

System under test Inference engine

Observations of test executions Equivalence implies test set adequacy

Lisp program Weyuker 1983

slide-10
SLIDE 10

USING INFERENCE TO ASSESS TEST SET ADEQUACY

T est input generator

Program inputs

System under test Inference engine

Observations of test executions Equivalence implies test set adequacy

Prolog program Bergadano and Gunetti 1996

slide-11
SLIDE 11

USING INFERENCE TO ASSESS TEST SET ADEQUACY

T est input generator

Program inputs

System under test Inference engine

Observations of test executions Equivalence implies test set adequacy

Harder et al. 2003 Xie, Notkin 2003 Invariants

X>0 Y < (A+B) Daikon

slide-12
SLIDE 12

USING INFERENCE TO ASSESS TEST SET ADEQUACY

T est input generator

Program inputs

System under test Inference engine

Observations of test executions Equivalence implies test set adequacy

Berg et al. 2005 Raffelt, Steffen 2006 Bollig et al. 2008 Shahbaz, Li, Groz 2006 Walkinshaw et al. 2009 FSM

Angluin State-merging

slide-13
SLIDE 13

USING INFERENCE TO ASSESS TEST SET ADEQUACY

T est input generator

Program inputs

System under test Inference engine

Observations of test executions

Hypothesis

X>0 Y < (A+B)

Undecidable

slide-14
SLIDE 14

USING INFERENCE TO ASSESS TEST SET ADEQUACY

T est input generator

Program inputs

System under test Inference engine

Observations of test executions

Hypothesis

X>0 Y < (A+B)

Lots of random tests W/WP-method (for FSMs)

slide-15
SLIDE 15

PROBLEM

Based on exact results - no flexibility

◮ The inferred model is either equivalent to the subject

system or not.

◮ The corresponding test set is either adequate or not.

◮ In reality, there is bound to be a certain degree of error.

◮ A test set may result in a model that is 99% correct, with

  • nly small, trivial errors

accuracy examples adequacy tests

slide-16
SLIDE 16

PROBLEM

Based on exact results - no flexibility

◮ The inferred model is either equivalent to the subject

system or not.

◮ The corresponding test set is either adequate or not.

◮ In reality, there is bound to be a certain degree of error.

◮ A test set may result in a model that is 99% correct, with

  • nly small, trivial errors

accuracy examples adequacy tests

slide-17
SLIDE 17

THE PROBABLY APPROXIMATELY CORRECT (PAC)

FRAMEWORK Setting

◮ There exists an instance space X ◮ The learning target is a concept c ⊂ X

◮ For any element x ∈ X, c(x) = 1 or 0

◮ There is a selection procedure EX(c, D) that randomly selects

elements in X

◮ The probability of them belonging to c is determined by

some static distribution D (not necessarily known)

◮ Given a labelled set of examples selected by EX, it is the

goal of the learning procedure to infer c

slide-18
SLIDE 18

THE PROBABLY APPROXIMATELY CORRECT (PAC)

FRAMEWORK Assessing a Learner

◮ Two problems

  • 1. Can only guarantee accurate result if supplied with every

possible instance in X.

  • 2. Given that samples are a random subset, there is the chance

that EX will supply a misleading sample.

◮ To address these issues, the success of a learner is

characterised as follows:

◮ δ - probability that the hypothesis will meet the success

conditions

◮ ε - allowable degree of error

slide-19
SLIDE 19

THE PROBABLY APPROXIMATELY CORRECT (PAC)

FRAMEWORK

Inference engine Evaluator example set A classifications Ex(c,D)

Hypothesis

slide-20
SLIDE 20

THE PROBABLY APPROXIMATELY CORRECT (PAC)

FRAMEWORK

example set B

Evaluator

probably approximately correct (or not)

classifications hypothesis classifications ε δ Ex(c,D)

Hypothesis

slide-21
SLIDE 21

USING PAC TO ASSESS TEST ADEQUACY

Inference engine Evaluator example set A classifications Ex(c,D)

Hypothesis

slide-22
SLIDE 22

USING PAC TO ASSESS TEST ADEQUACY

Inference engine Evaluator test set A test outcomes T est input generator Hypothesis

X>0 Y < (A+B)

slide-23
SLIDE 23

USING PAC TO ASSESS TEST ADEQUACY

Evaluator T est input generator Hypothesis

X>0 Y < (A+B)

probably approximately adequate (or not)

ε δ test set B hypothesis

  • utcomes

test outcomes

slide-24
SLIDE 24

USING PAC TO ASSESS TEST ADEQUACY

Assumptions

◮ Validity of final outcome must be interpreted with care

◮ Test set is being evaluated against itself ◮ Size of sets A and B must be sufficiently large and distinct ◮ Test set generator must be capable of (eventually)

exhaustively exercising the SUT

slide-25
SLIDE 25

CONCLUSIONS

◮ Inferring models from tests gives us a ’test-eye view’ of the

system

◮ Test adequacy can be assessed by measuring model

accuracy

◮ This can be achieved with established ML techniques ◮ For a given type of system (e.g. state-based) the PAC

approach can be used to assess and compare the general performance of testing techniques.

Challenge

Find the best combination of machine-learner and test-set generator.