• Keine Ergebnisse gefunden

Qualitätssicherung in der Softwareentwicklung VU 8 DI Dr. Bernhard K. Aichernig

N/A
N/A
Protected

Academic year: 2021

Aktie "Qualitätssicherung in der Softwareentwicklung VU 8 DI Dr. Bernhard K. Aichernig"

Copied!
61
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Qualitätssicherung in der Softwareentwicklung

VU 8

DI Dr. Bernhard K. Aichernig

Institut für Softwaretechnologie (IST) TU Graz

Sommersemester 2012

(2)

Outline

1

Conformance Testing Properties

2

Labelled Transition Systems Equivalence

Preorder ioco Examples

3

Test generation

(3)

Input/Output Conformance Relation

Jan Tretmans - 1996

Based on IO-Labeled Transition Systems

(4)

Input/Output Conformance Relation

Jan Tretmans - 1996

Based on IO-Labeled Transition Systems

(5)

Conformance Testing

(6)

Conformance Testing - Soundness

Test suite is sound:

conformance ⇒ all tests pass

(7)

Conformance Testing - Soundness

Test suite is sound:

conformance ⇒ all tests pass

(8)

Conformance Testing - Exhaustiveness

Test suite is exhaustive:

conformance ⇐ all tests pass

(9)

Conformance Testing - Exhaustiveness

Test suite is exhaustive:

conformance ⇐ all tests pass

(10)

Conformance Testing - Completeness

Test suite is complete:

conformance ≡ all tests pass

(11)

Conformance Testing - Completeness

Test suite is complete:

conformance ≡ all tests pass

(12)

Conformance Testing with ioco

System (Implementation) is modeled as IOTS

weakly input enabled

Specification is an IOLTS

possibly incomplete possible non-deterministic

!g1

τ τ

!g1 ?g2

?g2

!g3

!g3 !g1

(13)

Conformance Testing with ioco

System (Implementation) is modeled as IOTS

weakly input enabled

Specification is an IOLTS

possibly incomplete possible non-deterministic

!g1

τ τ

!g1 ?g2

?g2

!g3

!g3 !g1

(14)

Input Output Labeled Transition Systems

Input Output Labeled Transition System

An IOLTS is an LTS M = (Q

M

, A

M

, →

M

, q

0M

) with Q

M

a finite set of states

A

M

= A

MI

∪ A

MO

∪ {τ } where

AMI andAMO are input and output alphabets τ6∈AMI ∪AMO is an unobservable, internal action

M

⊆ Q

M

× A

M

× Q

M

is the transition relation q

0M

∈ Q

M

is the initial state.

QUESTION?

What means: The implementation conforms-to the

specification?

(15)

Input Output Labeled Transition Systems

Input Output Labeled Transition System

An IOLTS is an LTS M = (Q

M

, A

M

, →

M

, q

0M

) with Q

M

a finite set of states

A

M

= A

MI

∪ A

MO

∪ {τ } where

AMI andAMO are input and output alphabets τ6∈AMI ∪AMO is an unobservable, internal action

M

⊆ Q

M

× A

M

× Q

M

is the transition relation q

0M

∈ Q

M

is the initial state.

QUESTION?

What means: The implementation conforms-to the

specification?

(16)

How to relate 2 LTSs?

Equivalence Relations (=)

Bisimulation

Trace Equivalence Testing Equivalence ...

Preorder Relations (≤)

Trace Preorder Testing Preorder ...

Input-Output Relations

ioconf

ioco ...

...

(17)

(Weak) Bisimulation

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

Bisimulation is not suited for testing!

(18)

Trace Equivalence

A trace is an observable sequence of actions

Two states are trace equivalent iff they have the same traces

Trace equivalence is the weakest notion of conformance

(19)

Equivalence vs. Preorder Relations

Equivalence Relation (R)

reflexive (sRs)

symmetric: iRs→sRi transitive: iRs∧sRt →iRt

Preorder Relations (≤)

NOTnecessarily antisymmetric:

iRs↔i ≤s∧s≤i simplifies testing

e.g.: Trace Preorder

i ≤tr s↔traces(i)⊆traces(s)

(20)

Some Notations: Transitions

q →

aM

q

0

=

df

(q, a, q

0

) ∈→

M

q ⇒

q

0

=

df

(q = q

0

) ∨ (q →

τ M

q

1

∧ · · · ∧ q

n−1 τ

M

q

0

)

q ⇒

a

q

0

=

df

∃q

1

, q

2

: q ⇒

M

q

1

aM

q

2

M

q

0

(21)

Some Notations: Quiescence

δ is used to represent quiescence

q−→δ q=dfq is a quiescent state.

Quiescent state = no edge labeled with an output or an

internal action

(22)

Some Notations: Quiescence

δ is used to represent quiescence

q−→δ q=dfq is a quiescent state.

Quiescent state = no edge labeled with an output or an

internal action

(23)

Some Notations: Suspension Automaton

∆(M) = (Q

M

, A

∆(M)

, →

∆(M)

, q

0M

) where:

A∆(M)=AM∪ {δ}withδ∈A∆(M)O

∆(M)is obtained from→M by adding loopsq→δ qfor each quiescent state

(24)

Some Notations: After

q after

M

σ =

df

{q

0

| q ⇒

σM

q

0

} Q after

M

σ =

df

S

q∈Q

(q after

M

σ).

(25)

Some Notations: Out

Out

M

(q) =

df

{a ∈ A

MO

| q →

aM

} Out

M

(Q) =

df

S

q∈Q

(Out

M

(q))

(26)

ioco

Definition: ioco

Let IUT = (Q

IUT

, A

IUT

, →

IUT

, q

0IUT

) be weakly input enabled with A

IUT

= A

IUTI

∪ A

IUTO

∪ {τ } and S = Q

S

, A

S

, →

S

, q

0S

be strongly responsive with A

S

= A

SI

∪ A

SO

∪ {τ }. Then:

IUT ioco S =

df

∀σ ∈ traces(∆(S)) :

Out

IUT

(∆(IUT ) after

IUT

σ) ⊆ Out

S

(∆(S) after

S

σ).

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

possible in S after an arbitrary suspension trace of S.

(27)

ioco

Definition: ioco

Let IUT = (Q

IUT

, A

IUT

, →

IUT

, q

0IUT

) be weakly input enabled with A

IUT

= A

IUTI

∪ A

IUTO

∪ {τ } and S = Q

S

, A

S

, →

S

, q

0S

be strongly responsive with A

S

= A

SI

∪ A

SO

∪ {τ }. Then:

IUT ioco S =

df

∀σ ∈ traces(∆(S)) :

Out

IUT

(∆(IUT ) after

IUT

σ) ⊆ Out

S

(∆(S) after

S

σ).

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

possible in S after an arbitrary suspension trace of S.

(28)

P ioco S?

P ioco S =

df

∀σ ∈ traces(∆(S)) :

Out

IUT

(∆(P) after

IUT

σ) ⊆ Out

S

(∆(S) after

S

σ).

(29)

P ioco S?

P ioco S =

df

∀σ ∈ traces(∆(S)) :

Out

IUT

(∆(P) after

IUT

σ) ⊆ Out

S

(∆(S) after

S

σ).

(30)

P ioco S?

P ioco S =

df

∀σ ∈ traces(∆(S)) :

Out

IUT

(∆(P) after

IUT

σ) ⊆ Out

S

(∆(S) after

S

σ).

(31)

P ioco S?

P ioco S =

df

∀σ ∈ traces(∆(S)) :

Out

IUT

(∆(P) after

IUT

σ) ⊆ Out

S

(∆(S) after

S

σ).

(32)

P ioco S?

P ioco S =

df

∀σ ∈ traces(∆(S)) :

Out

IUT

(∆(P) after

IUT

σ) ⊆ Out

S

(∆(S) after

S

σ).

(33)

P ioco S?

P ioco S =

df

∀σ ∈ traces(∆(S)) :

Out

IUT

(∆(P) after

IUT

σ) ⊆ Out

S

(∆(S) after

S

σ).

(34)

P ioco S?

P ioco S =

df

∀σ ∈ traces(∆(S)) :

Out

IUT

(∆(P) after

IUT

σ) ⊆ Out

S

(∆(S) after

S

σ).

(35)

P ioco S?

P ioco S =

df

∀σ ∈ traces(∆(S)) :

Out

IUT

(∆(P) after

IUT

σ) ⊆ Out

S

(∆(S) after

S

σ).

(36)

P ioco S?

P ioco S =

df

∀σ ∈ traces(∆(S)) :

Out

IUT

(∆(P) after

IUT

σ) ⊆ Out

S

(∆(S) after

S

σ).

(37)

P ioco S?

P ioco S =

df

∀σ ∈ traces(∆(S)) :

Out

IUT

(∆(P) after

IUT

σ) ⊆ Out

S

(∆(S) after

S

σ).

(38)

P ioco S?

P ioco S =

df

∀σ ∈ traces(∆(S)) :

Out

IUT

(∆(P) after

IUT

σ) ⊆ Out

S

(∆(S) after

S

σ).

(39)

P ioco S?

P ioco S =

df

∀σ ∈ traces(∆(S)) :

Out

IUT

(∆(P) after

IUT

σ) ⊆ Out

S

(∆(S) after

S

σ).

(40)

Test Cases

A test case is an IOLTS

Inputs = Outputs IUT, Outputs = Inputs IUT Equipped with verdict states (pass, fail) In each state (except Pass, Fail):

Single output and all inputs

All inputs andθ

(41)

Formal Test Execution

(42)

Formal Test Execution

(43)

Formal Test Execution

(44)

Formal Test Execution

(45)

Formal Test Execution

(46)

Formal Test Execution

(47)

Formal Test Execution

(48)

Formal Test Execution

(49)

Formal Test Execution

(50)

Formal Test Execution

(51)

Formal Test Execution

(52)

A Complete Test Generation Algorithm

Given the suspension automaton of a specification as an LTS S = (Q

S

, A

S

, →

S

, q

0S

)

1

Initially compute K = q

0S

after

S

2

Do non-deterministically, either:

Stop test case with verdictpass

Let the test case produce an output (!a) with K0=K afterS?a6=∅.

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

Accept all inputs (and quiescence) and add fail states for unexpected results. Compute newK0for valid inputs.

3

Repeat Step 2 with new set K

0

.

(53)

A Complete Test Generation Algorithm

δ

δ

(54)

A Complete Test Generation Algorithm

δ

δ

(55)

A Complete Test Generation Algorithm

δ

δ

(56)

A Complete Test Generation Algorithm

δ

δ

(57)

A Complete Test Generation Algorithm

δ

δ

(58)

A Complete Test Generation Algorithm

δ

δ

(59)

A Complete Test Generation Algorithm

δ

δ

(60)

Tools

TGV

jTorX

(61)

References

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.

Referenzen

ÄHNLICHE DOKUMENTE

Taanis ollakse seisukohal, et teaduse toorandmete säilitamine peaks olema reguleeritud keskselt riigi tasandil ning neid peaks säilitama ühtses rahvuslikus (või rahvusvahelises)

There are those that significantly and continuously under-perform, lurching from crisis to crisis, a roller coaster of political and economic collapse, but do not explode into

Block size, scanning rate, synchronization, and all other control functions associated with the analog input data, are controlled and monitored by the short I/O

Table A 1: Internal consistency measure by Cronbach's Alpha of the used scales for the pre-test

Oft sind die für die Herstellung eines landwirtschaftlichen Inputs berücksichtigten Energie- träger, soweit sie überhaupt bekannt sind, auf sehr unbestimmte Weise definiert

C VFSTATION -Value of the Validation_Flag in the Station header C Array VFSTNDATA of the Validation_Flags for each standard level C Array of temperature TEM(k) for the station

Predictive Maintenance: A manufacturing company wants to predict the time points of machinery breakdowns and the optimal time point to?. perform the machinery maintenance before

In this paper we shall not use time explicitly as a control variable but shall seek the causal factor that directly leads to changes in system dynamics3. This is the proxiroate