• No results found

How To Understand The Rules Of The Game Of Chess

N/A
N/A
Protected

Academic year: 2021

Share "How To Understand The Rules Of The Game Of Chess"

Copied!
61
0
0

Loading.... (view fulltext now)

Full text

(1)

tugraz

Quality Assurance in Software Development

Qualitätssicherung in der Softwareentwicklung

A.o.Univ.-Prof. Dipl.-Ing. Dr. Bernhard Aichernig

Institute for Software Technology

Graz University of Technology

Austria

(2)

tugraz

Agenda

1

Conformance Testing

Properties

2

Labelled Transition Systems

Equivalence

Preorder

ioco

Examples

(3)

tugraz

Input/Output Conformance Relation

I

Jan Tretmans - 1996

(4)

tugraz

Input/Output Conformance Relation

I

Jan Tretmans - 1996

(5)

tugraz

(6)

tugraz

Conformance Testing - Soundness

I

Test suite is sound: conformance

all tests pass

(7)

tugraz

Conformance Testing - Soundness

I

Test suite is sound: conformance

(8)

tugraz

Conformance Testing - Exhaustiveness

I

Test suite is exhaustive:

conformance

all tests pass

(9)

tugraz

Conformance Testing - Exhaustiveness

I

Test suite is exhaustive:

(10)

tugraz

Conformance Testing - Completeness

I

Test suite is complete:

conformance

all tests pass

(11)

tugraz

Conformance Testing - Completeness

I

Test suite is complete:

(12)

tugraz

Conformance Testing with ioco

I

System (Implementation) is modeled as IOTS

I

weakly input enabled

I

Specification is an IOLTS

I

possibly incomplete

I

possible non-deterministic

!g1

τ

τ

!g1

?g2

?g2

!g3

!g3

!g1

(13)

tugraz

Conformance Testing with ioco

I

System (Implementation) is modeled as IOTS

I

weakly input enabled

I

Specification is an IOLTS

I

possibly incomplete

I

possible non-deterministic

!g1

τ

τ

!g1

?g2

?g2

!g3

!g3

!g1

(14)

tugraz

Input Output Labeled Transition Systems

Input Output Labeled Transition System

An IOLTS is an LTS

M

= (

Q

M

,

A

M

,

M

,

q

0

M

)

with

I

Q

M

a finite set of states

I

A

M

=

A

M

I

A

M

O

∪ {

τ

}

where

I

A

MI

and

A

M

O

are input and output alphabets

I

τ

6∈

A

M

I

A

MO

is an unobservable, internal action

I

M

Q

M

×

A

M

×

Q

M

is the transition relation

I

q

M

0

Q

M

is the initial state.

QUESTION?

(15)

tugraz

Input Output Labeled Transition Systems

Input Output Labeled Transition System

An IOLTS is an LTS

M

= (

Q

M

,

A

M

,

M

,

q

0

M

)

with

I

Q

M

a finite set of states

I

A

M

=

A

M

I

A

M

O

∪ {

τ

}

where

I

A

MI

and

A

M

O

are input and output alphabets

I

τ

6∈

A

M

I

A

MO

is an unobservable, internal action

I

M

Q

M

×

A

M

×

Q

M

is the transition relation

I

q

M

0

Q

M

is the initial state.

QUESTION?

(16)

tugraz

How to relate 2 LTSs?

I

Equivalence Relations (=)

I

Bisimulation

I

Trace Equivalence

I

Testing Equivalence

I

...

I

Preorder Relations (

)

I

Trace Preorder

I

Testing Preorder

I

...

I

Input-Output Relations

I

ioconf

I

ioco

I

...

I

...

(17)

tugraz

(Weak) Bisimulation

I

Two states are bisimilar iff they simulate each other and go to

states which are bisimilar

(18)

tugraz

Trace Equivalence

I

A trace is an observable sequence of actions

I

Two states are trace equivalent iff they have the same traces

(19)

tugraz

Equivalence vs. Preorder Relations

I

Equivalence Relation (

R

)

I

reflexive (

s

R

s

)

I

symmetric:

i

R

s

s

R

i

I

transitive:

i

R

s

s

R

t

i

R

t

I

Preorder Relations (

)

I

NOT

necessarily antisymmetric:

I

i

R

s

i

s

s

i

I

simplifies testing

I

e.g.: Trace Preorder

(20)

tugraz

Some Notations: Transitions

I

q

a

M

q

0

=

df

(

q

,

a

,

q

0

)

∈→

M

I

q

q

0

=

df

(

q

=

q

0

)

(

q

τ

M

q

1

∧ · · · ∧

qn

1

τ

M

q

0

)

I

q

a

q

0

=

df

q

1

,

q

2

:

q

M

q

1

a

M

q

2

M

q

0

(21)

tugraz

Some Notations: Quiescence

I

δ

is used to represent quiescence

I

q

δ

q

=

df

q

is a quiescent state.

I

Quiescent state = no edge labeled with an output or an internal

(22)

tugraz

Some Notations: Quiescence

I

δ

is used to represent quiescence

I

q

δ

q

=

df

q

is a quiescent state.

I

Quiescent state = no edge labeled with an output or an internal

(23)

tugraz

Some Notations: Suspension Automaton

I

∆(

M

) = (

Q

M

,

A

∆(

M

)

,

∆(

M

)

,

q

0

M

)

where:

I

A

∆(M)

=

A

M

∪ {

δ

}

with

δ

A

∆(M) O

I

→∆(

M)

is obtained from

M

by adding loops

q

δ

q

for each

quiescent state

(24)

tugraz

Some Notations: After

I

q

after

M

σ

=

df

{

q

0

|

q

σ

M

q

0

}

I

Q

after

M

σ

=

df

S

q

Q

(

q

after

M

σ

)

.

(25)

tugraz

Some Notations: Out

I

OutM

(

q

) =

df

{

a

A

M

O

|

q

a

M

}

I

Out

M

(

Q

) =

df

S

q

Q

(

Out

M

(

q

))

(26)

tugraz

ioco

Definition: ioco

Let

IUT

= (

Q

IUT

,

A

IUT

,

IUT

,

q

IUT

0

)

be weakly input enabled with

A

IUT

=

A

IUT

I

A

IUT

O

∪ {

τ

}

and

S

=

Q

S

,

A

S

,

S

,

q

0

S

be strongly

responsive with

A

S

=

A

S

I

A

S

O

∪ {

τ

}

. Then:

IUT

ioco

S

=

df

σ

traces

(∆(

S

)) :

Out

IUT

(∆(

IUT

)

after

IUT

σ

)

Out

S

(∆(

S

)

after

S

σ

)

.

I

IUT ioco S iff outputs (and quiescences) of the IUT are possible in

S after an arbitrary suspension trace of S.

(27)

tugraz

ioco

Definition: ioco

Let

IUT

= (

Q

IUT

,

A

IUT

,

IUT

,

q

IUT

0

)

be weakly input enabled with

A

IUT

=

A

IUT

I

A

IUT

O

∪ {

τ

}

and

S

=

Q

S

,

A

S

,

S

,

q

0

S

be strongly

responsive with

A

S

=

A

S

I

A

S

O

∪ {

τ

}

. Then:

IUT

ioco

S

=

df

σ

traces

(∆(

S

)) :

Out

IUT

(∆(

IUT

)

after

IUT

σ

)

Out

S

(∆(

S

)

after

S

σ

)

.

I

IUT ioco S iff outputs (and quiescences) of the IUT are possible in

(28)

tugraz

P ioco S?

P

ioco

S

=

df

σ

traces

(∆(

S

)) :

(29)

tugraz

P ioco S?

P

ioco

S

=

df

σ

traces

(∆(

S

)) :

(30)

tugraz

P ioco S?

P

ioco

S

=

df

σ

traces

(∆(

S

)) :

(31)

tugraz

P ioco S?

P

ioco

S

=

df

σ

traces

(∆(

S

)) :

(32)

tugraz

P ioco S?

P

ioco

S

=

df

σ

traces

(∆(

S

)) :

(33)

tugraz

P ioco S?

P

ioco

S

=

df

σ

traces

(∆(

S

)) :

(34)

tugraz

P ioco S?

P

ioco

S

=

df

σ

traces

(∆(

S

)) :

(35)

tugraz

P ioco S?

P

ioco

S

=

df

σ

traces

(∆(

S

)) :

(36)

tugraz

P ioco S?

P

ioco

S

=

df

σ

traces

(∆(

S

)) :

(37)

tugraz

P ioco S?

P

ioco

S

=

df

σ

traces

(∆(

S

)) :

(38)

tugraz

P ioco S?

P

ioco

S

=

df

σ

traces

(∆(

S

)) :

(39)

tugraz

P ioco S?

P

ioco

S

=

df

σ

traces

(∆(

S

)) :

(40)

tugraz

Test Cases

I

A test case is an IOLTS

I

Inputs = Outputs IUT, Outputs = Inputs IUT

I

Equipped with verdict states (pass, fail)

I

In each state (except Pass, Fail):

I

Single output and

all inputs

(41)

tugraz

(42)

tugraz

(43)

tugraz

(44)

tugraz

(45)

tugraz

(46)

tugraz

(47)

tugraz

(48)

tugraz

(49)

tugraz

(50)

tugraz

(51)

tugraz

(52)

tugraz

A Complete Test Generation Algorithm

Given the suspension automaton of a specification as an LTS

S

= (

Q

S

,

A

S

,

S

,

q

0

S

)

1

Initially compute

K

=

q

S

0

after

S

2

Do non-deterministically, either:

I

Stop test case with verdict

pass

I

Let the test case produce an output (!a) with

K

0

=

K

after

S?

a

6

=

.

I

Also accept all inputs at the same time and add fail states for

unexpected results.

I

Accept all inputs (and quiescence) and add fail states for

unexpected results. Compute new

K

0

for valid inputs.

(53)

tugraz

A Complete Test Generation Algorithm

δ

(54)

tugraz

A Complete Test Generation Algorithm

δ

(55)

tugraz

A Complete Test Generation Algorithm

δ

(56)

tugraz

A Complete Test Generation Algorithm

δ

(57)

tugraz

A Complete Test Generation Algorithm

δ

(58)

tugraz

A Complete Test Generation Algorithm

δ

(59)

tugraz

A Complete Test Generation Algorithm

δ

(60)

tugraz

Tools

I

TGV: offline testing tool

I

jTorX: online testing

I

MoMut: offline model-based mutation testing tool, AIT and TU

Graz

I

SpecExplorer: uses

Alternating Simulation

(equivalent to ioco for

(61)

tugraz

References

I

Martin Weiglhofer, Bernhard Aichernig, and Franz Wotawa.

Fault-based conformance testing in practice. International Journal

of Software and Informatics, 3(2-3):375–411, June/September

2009. Copyright by Institute for Software, Chinese Academy of

Science.

References

Related documents