Voorbeeld ADS in elkaar gepleurd
This commit is contained in:
parent
671f5ccf1f
commit
54bbd389e0
1 changed files with 72 additions and 13 deletions
|
@ -5,8 +5,8 @@
|
||||||
[title={FSM-based Test Methods},
|
[title={FSM-based Test Methods},
|
||||||
reference=chap:test-methods]
|
reference=chap:test-methods]
|
||||||
|
|
||||||
In this chapter we will discuss some of the theory of test generation methods.
|
In this chapter we will discuss some of the theory of test generation methods for black box conformance testing.
|
||||||
From this theoretical discussion we derive a new algorithm: the \emph{hybrid ADS methods}, which is applied on a case study in the next chapter (\in{Chapter}[chap:applying-automata-learning]).
|
From a theoretical discussion we derive a new algorithm: the \emph{hybrid ADS methods}, which is applied on a case study in the next chapter (\in{Chapter}[chap:applying-automata-learning]).
|
||||||
A key aspect of such methods is the size of the obtained test suite.
|
A key aspect of such methods is the size of the obtained test suite.
|
||||||
On one hand we want to cover as much as the specification as possible.
|
On one hand we want to cover as much as the specification as possible.
|
||||||
On the other hand: testing takes time, so we want to minimise the size of a test suite.
|
On the other hand: testing takes time, so we want to minimise the size of a test suite.
|
||||||
|
@ -175,6 +175,10 @@ We are often interested in the case of $m$-completeness, where $m = n + k$ for s
|
||||||
Here $k$ will stand for the number of \emph{extra states} we can test.
|
Here $k$ will stand for the number of \emph{extra states} we can test.
|
||||||
The issue of an unknown bound is addressed later in the paper.
|
The issue of an unknown bound is addressed later in the paper.
|
||||||
|
|
||||||
|
Note the order of the quantifiers in the above definition.
|
||||||
|
We ask for a single test suite which works for all implementations of bounded size.
|
||||||
|
This is crucial for black box testing, as we do not know the implementation, so the test suite has to work for all of them.
|
||||||
|
|
||||||
|
|
||||||
\stopsubsection
|
\stopsubsection
|
||||||
\startsubsection
|
\startsubsection
|
||||||
|
@ -231,25 +235,16 @@ We require that all sets are \emph{prefix-closed}, however, we only give the max
|
||||||
\item A \defn{state identifier} for a state $s \in M$ is a set $W_s$ which contains a separating sequence for every other state $t \in M$.
|
\item A \defn{state identifier} for a state $s \in M$ is a set $W_s$ which contains a separating sequence for every other state $t \in M$.
|
||||||
\item A set of state identifiers $\{ W_s \}_{s}$ is \defn{harmonised} if a separating sequence $w$ for states $s$ and $t$ exists in both $W_s$ and $W_t$.
|
\item A set of state identifiers $\{ W_s \}_{s}$ is \defn{harmonised} if a separating sequence $w$ for states $s$ and $t$ exists in both $W_s$ and $W_t$.
|
||||||
This is also called a \defn{separating family}.
|
This is also called a \defn{separating family}.
|
||||||
\item Following the results of \citet[DBLP:journals/tc/LeeY94], a separating family where each set is the prefix-closure of a single word is called an \defn{adaptive distinguishing sequence} (ADS).
|
|
||||||
\stopitemize
|
\stopitemize
|
||||||
\stopdefinition
|
\stopdefinition
|
||||||
|
|
||||||
The property of being harmonised might seem a bit strange.
|
The property of being harmonised might seem a bit strange.
|
||||||
This property ensure that the same tests are used for different states.
|
This property ensure that the same tests are used for different states.
|
||||||
This extra consistency within a test suite is necessary for some test methods.
|
This extra consistency within a test suite is necessary for some test methods.
|
||||||
A counterexample is given in \in{Example}[ex:uio-counterexample].
|
We return to this notion in more detail in \in{Example}[ex:uio-counterexample].
|
||||||
|
|
||||||
An ADS is of special interest since they can identify a state using a single word.
|
|
||||||
It is called an adaptive sequence, since it has a tree structure which depends on the output of the machine.
|
|
||||||
To see this, consider the first symbols of each of the sequences in the family.
|
|
||||||
Since the family is harmonised and each set is given by a single word, there is only one first symbol.
|
|
||||||
So we test each state with one symbol, observe the output, and then continue with the remainder of the sequence (which depends on the output).
|
|
||||||
\todo{plaatje?}
|
|
||||||
|
|
||||||
We may obtain a characterisation set by taking the union of state identifiers for each state.
|
We may obtain a characterisation set by taking the union of state identifiers for each state.
|
||||||
For every machine we can construct a set of harmonised state identifiers as will be shown in \in{Chapter}[chap:separating-sequences] and hence every machine has a characterisation set.
|
For every machine we can construct a set of harmonised state identifiers as will be shown in \in{Chapter}[chap:separating-sequences] and hence every machine has a characterisation set.
|
||||||
However, an adaptive distinguishing sequence may not exist, even if every state has an UIO.
|
|
||||||
|
|
||||||
\startexample
|
\startexample
|
||||||
As mentioned before, state $s_2$ from \in{Figure}[fig:running-example] has a state identifier $\{aa, ac, b\}$.
|
As mentioned before, state $s_2$ from \in{Figure}[fig:running-example] has a state identifier $\{aa, ac, b\}$.
|
||||||
|
@ -258,9 +253,73 @@ Since the other states have UIOs, we can pick singleton sets as state identifier
|
||||||
For example, state $s_0$ has the UIO $aa$, so a state identifier for $s_0$ is $W_0 = \{ aa \}$.
|
For example, state $s_0$ has the UIO $aa$, so a state identifier for $s_0$ is $W_0 = \{ aa \}$.
|
||||||
Similarly, we can take $W_1 = \{ a \}$ and $W_3 = \{ c \}$.
|
Similarly, we can take $W_1 = \{ a \}$ and $W_3 = \{ c \}$.
|
||||||
But note that such a family will \emph{not} be harmonised since the sets $\{ a \}$ and $\{ c \}$ have no common separating sequence.
|
But note that such a family will \emph{not} be harmonised since the sets $\{ a \}$ and $\{ c \}$ have no common separating sequence.
|
||||||
There is no ADS for this machine.
|
|
||||||
\stopexample
|
\stopexample
|
||||||
|
|
||||||
|
One more type of state identifier is of our interest: the \emph{adaptive distinguishing sequence}.
|
||||||
|
It it the strongest type of state identifier, and as a result not many machine have one.
|
||||||
|
|
||||||
|
\startdefinition
|
||||||
|
Following the results of \citet[DBLP:journals/tc/LeeY94], a separating family where each set is the prefix-closure of a single word is called an \defn{adaptive distinguishing sequence} (ADS).
|
||||||
|
\stopdefinition
|
||||||
|
|
||||||
|
An ADS is of special interest since they can identify a state using a single word.
|
||||||
|
It is called an adaptive sequence, since it has a tree structure which depends on the output of the machine.
|
||||||
|
To see this, consider the first symbols of each of the sequences in the family.
|
||||||
|
Since the family is harmonised and each set is given by a single word, there is only one first symbol.
|
||||||
|
So we test each state with one symbol, observe the output, and then continue with the remainder of the sequence (which depends on the output).
|
||||||
|
\todo{Verwijs naar plaatje}
|
||||||
|
Given an ADS, there exists an UIO for every state.
|
||||||
|
The converse -- if every state has an UIO, then the machine admits an ADS-- does not hold.
|
||||||
|
|
||||||
|
The machine in \in{Figure}[fig:running-example] admits no ADS, since $s_2$ has no UIO.
|
||||||
|
|
||||||
|
\startplacefigure
|
||||||
|
[title={(a): A Mealy machine with alphabets $I = \{a, b\}$ and $O = \{0, 1\}$ and (b): an ADS for (a). },
|
||||||
|
list={A Mealy machine and its ADS.}
|
||||||
|
reference=fig:ads-example]
|
||||||
|
\startcombination[nx=2, ny=1, align=center]
|
||||||
|
{\hbox{
|
||||||
|
\starttikzpicture
|
||||||
|
\node[initial, state] (0) {$s_0$};
|
||||||
|
\node[state] (1) [right=of 0] {$s_1$};
|
||||||
|
\node[state] (2) [below=of 1] {$s_2$};
|
||||||
|
\node[state] (3) [left =of 2] {$s_3$};
|
||||||
|
\path[->]
|
||||||
|
(0) edge node [above] {$a/0, b/0$} (1)
|
||||||
|
(1) edge node [right] {$a/1$} (2)
|
||||||
|
(2) edge node [above] {$a/0, b/0$} (3)
|
||||||
|
(3) edge node [left, align=left] {$a/1,$ \\ $b/0$} (0)
|
||||||
|
(1) edge [loop right] node {$b/0$} (1);
|
||||||
|
\stoptikzpicture}} {(a)}
|
||||||
|
{\hbox{
|
||||||
|
\starttikzpicture[node distance=.75cm]
|
||||||
|
\node (0) {$a$};
|
||||||
|
\node [below left=of 0] (1) {$b$};
|
||||||
|
\node [below=of 1] (3) {$a$};
|
||||||
|
\node [below left=of 3] (5) {$2$};
|
||||||
|
\node [below right=of 3] (6) {$0$};
|
||||||
|
\node [below right=of 0] (2) {$a$};
|
||||||
|
\node [below=of 2] (4) {$b$};
|
||||||
|
\node [below=of 4] (7) {$a$};
|
||||||
|
\node [below left=of 7] (8) {$1$};
|
||||||
|
\node [below right=of 7] (9) {$3$};
|
||||||
|
|
||||||
|
\path[->]
|
||||||
|
(0)+(0,.75) edge (0)
|
||||||
|
(0) edge node [above left] {$0$} (1)
|
||||||
|
(0) edge node [above right] {$1$} (2)
|
||||||
|
(1) edge node [left] {$0$} (3)
|
||||||
|
(3) edge node [above left] {$0$} (5)
|
||||||
|
(3) edge node [above right] {$1$} (6)
|
||||||
|
(2) edge node [right] {$0$} (4)
|
||||||
|
(4) edge node [right] {$0$} (7)
|
||||||
|
(7) edge node [above left] {$0$} (8)
|
||||||
|
(7) edge node [above right] {$1$} (9);
|
||||||
|
\stoptikzpicture}} {(b)}
|
||||||
|
\stopcombination
|
||||||
|
\stopplacefigure
|
||||||
|
|
||||||
|
\todo{Dit staat een beetje random}
|
||||||
Besides sequences which separate states, we also need sequences which brings a machine to specified states.
|
Besides sequences which separate states, we also need sequences which brings a machine to specified states.
|
||||||
|
|
||||||
\startdefinition
|
\startdefinition
|
||||||
|
|
Reference in a new issue