Studying the separability relation between finite state machines

FSMs are widely used in various application domains such as telecommunication systems, communication protocols and other systems. Existence of a separating sequence of two FSMs depends on the number of nondeterministic transitions in these FSMs.

Рубрика Программирование, компьютеры и кибернетика
Вид реферат
Язык английский
Дата добавления 20.08.2010
Размер файла 676,4 K

Отправить свою хорошую работу в базу знаний просто. Используйте форму, расположенную ниже

Студенты, аспиранты, молодые ученые, использующие базу знаний в своей учебе и работе, будут вам очень благодарны.

26

25

Referat

Studying the separability relation between finite state machines

2010

Abstract: Many authors have studied relations between nondeterministic Finite State Machines (FSMs). These relations can be used, for example, for deriving conformance tests from specifications represented by FSMs. In this paper, the separability relation between FSMs is studied. In particular, an algorithm is presented that derives a shortest separating sequence of two nondeterministic FSMs. Given FSMs S with n states and T with m states it is shown that the upper bound on the length of a shortest separating sequence is 2mn-1. Moreover, the upper bound is shown to be reachable. However, according to the conducted experiments, on average, the length of a shortest separating sequence of FSMs S and T states is less than mn and the existence of a separating sequence significantly depends on the number of nondeterministic transitions in these FSMs. The proposed algorithm can be also used for deriving a separating sequence of two different states of a single FSM or for deriving a separating sequence of three or more FSMs.

Index Terms: finite state machines, separability relation, conformance testing

1. INTRODUCTION

Finite State Machines (FSMs) are widely used in various application domains such as telecommunication systems, communication protocols and other reactive systems. In particular, FSMs are the underlying models for formal description techniques such as SDL and UML State Diagrams. Many conformance test derivation methods have been developed for deriving tests when the system specification and implementation are represented by deterministic FSMs. For related surveys, tools, and experiments a reader may refer to [1-5]. Moreover, many methods have been proposed for test derivation against nondeterministic FSM specifications [7-22]. Non-determinism in the specification occurs due to various reasons such as performance, flexibility, limited controllability, and abstraction [14] [17] [19] [23].

A number of methods have been proposed for test generation against nondeterministic FSM specifications with respect to various conformance relations. Some of these methods, as those given in [7, 8] [20], derive test suites with the unknown fault coverage. Many other methods derive test suites with the guaranteed fault coverage with respect to appropriate fault models. The methods given in [9] and [10] derive test suites with respect to the equivalence relation for a nondeterministic implementation against a nondeterministic specification while the methods given in [12], [14], [15], and [16] derive test suites for a complete deterministic implementation against a nondeterministic specification with respect to the reduction relation. Two FSMs are equivalent if they have the same input/output behavior and an FSM T is a reduction of FSM S if the input/output behavior of T is a subset of that of S. Hierons [17] presented a test derivation method with respect to the reduction relation when a system implementation can be nondeterministic. Petrenko et al. [21] generalize the work given in [24] and proposed a method that derives a test suite with respect to the reduction and equivalence relations for a nondeterministic implementation against possibly a partial specification.

When deriving test suites with respect to the reduction and equivalence relations with the guaranteed fault coverage the so-called complete testing assumption [9-10] (called "all weather conditions" by Milner in [25]) is assumed to be satisfied when testing a nondeterministic implementation. The assumption supposes that if an input sequence (a test case) is applied a number of times to a nondeterministic implementation, then all possible output sequences of the implementation can be observed. However, when an implementation under test has a limited controllability, as it happens, for instance, in remote testing, the complete testing assumption cannot be satisfied. In this case, the only relation that can be used for test derivation with the guaranteed fault coverage [26] [27] is the separability relation defined by Starke in [28]. Two FSMs are separable if there is an input sequence, called a separating sequence, such that the sets of output responses of these FSMs to the sequence do not intersect, i.e., the sets are disjoint. However, the separability relation is not properly studied yet. It is known [21] [27] that test suites derived with respect to the equivalence and reduction relations cannot be used for testing the separability relation. The fact that an FSM with m states is not equivalent (or is not a reduction) of an FSM with n states can always be established by an input sequence of length up to mn [21], while there exist two FSMs which can be separated only with an input sequence of exponential length [11].

Alur et al. [11] and Petrenko et al. [12] studied another relation, the so-called r-distinguishability relation. Petrenko et al. [12] employed this relation to reduce length of test suites derived with respect to the reduction relation. Two states s1 and s2 of a complete nondeterministic FSM are r-distinguishable if a state s of any complete FSM cannot be a reduction of both states s1 and s2 [21]. However, differently from the notion of state distinguishability for deterministic FSMs, in general, two r-distinguishable states can only be distinguished with a set of input sequences rather than with a single sequence. If states s1 and s2 are r-distinguishable with an r-distinguishablity set W then [21], given a state s of any complete FSM there always exists an input sequence in W such that the set of output responses at state s in response to this sequence is not a subset of that at state s1 or at state s2. Alur et al. [11] showed that a sequence in a shortest r-distinguishability set is of polynomial length and correspondingly, in an adaptive experiment, a state identification sequence of a nondeterministic FSM has polynomial length. However, when deriving a preset test suite against a nondeterministic specification FSM, the whole r-distinguishability set [12] [21] is needed for state identification. Separable states are r-distinguishable with a single sequence and therefore; separating sequences can be used for shortening test suites derived with respect to the reduction relation and separable states are r-distinguishable but the converse is not always true [11-12].

Alur et al. [11] proposed an algorithm for deriving a separating sequence for two separable states of an FSM with n states. At the first step of the algorithm, a finite automaton with states is derived. Based on this automaton a separating sequence can be derived when such a sequence exists. Moreover, as shown in Alur et al. [11], the upper bound on the length of a shortest separating sequence is exponential. However, Alur et al. do not give the exact upper bound and to the best of our knowledge no experiments are presented yet for estimating length of separating sequences.

In this paper, an algorithm is proposed that derives a shortest separating sequence of two given FSMs (if such a sequence exists) without the complete derivation of an automaton with exponential number of states as done in Alur et al. [11]. Moreover, some properties of a separating sequence are studied; in particular, it is shown that given FSMs S with n states and T with m states, the length of a shortest separating sequence is at most 2mn-1. Given two arbitrary integers n and m, it is also shown that there always exist FSMs S with n states and T with m states such that length of a shortest separating sequence equals to 2mn-1.

Experiments with the proposed algorithm show that on average, the length of a shortest separating sequence of two FSMs S with n states and T with m states is less than mn and the existence of a separating sequence significantly depends on the number of nondeterministic transitions in these FSMs. For all conducted experiments the upper bound 2mn-1 on the length of a separating sequence was never reached.

This paper is organized as follows. Section 2 contains preliminaries related to FSMs. In Section 3, an algorithm is presented for deriving a shortest separating sequence of two separable FSMs. In addition, the upper bound on length of a separating sequence is determined and shown to be reachable. Section 4 contains an application example, Section 5 includes experimental results, and Section 6 concludes the paper.

2. PRELIMINARIES

A finite state machine (FSM) S, simply called a machine throughout the paper, is a 5-tuple S, I, O, h, s1, where S is a finite nonempty set with s1 as the initial state; I and O are finite input and output alphabets; and h S I O S is a behavior relation. The behavior relation defines all possible transitions of the machine. Given a current state sj and an input symbol i, a 4-tuple (sj,i,o,sk) h represents a possible transition from state sj under the input i to the next state sk with the output o. A machine is deterministic if for each pair (s,i)SI there exists at most one pair (o,s)OS such that (s,i,o,s)h; otherwise, the machine is called nondeterministic. If for each pair (s,i)SI there exists (o,s)OS such that (s,i,o,s)h then FSM S is said to be complete; otherwise, the machine is called partial. Given FSMs S = S, I, O, h, s1 and T =T,I,O,g,t1, FSM T is a submachine of S if T S, t1 = s1 and g h.

Given FSM S = S, I, O, h, s1, state s and an input i, state s is a successor of state s under the input i or simply an i-successor of state s if there exist o O such that the 4-tuple (s,i,o,s)h. Given a set of states M S and an input i, the set of states M is a successor of the set M under the input i or simply an i-successor of M if M is the set of all i-successors of states of the set M.

In a usual way, the behavior relation is extended to input and output sequences. Given states s,s S, an input sequence = i1i2…ik I* and an output sequence = o1o2…ok O*, there is a transition (s, , , s)h if there exist states s1=s, s2, … , sk, sk+1=s such that (si,ii,oi,si+1)h, i = 1, … , k. In this case, the input sequence is a defined input sequence at state s. Given states s and s, the defined input sequence can take (or simply takes) the FSM S from state s to state s if there exists an output sequence such that (s, , , s)h. The set successor(s, ) denotes the set of all states reachable from state s after applying the defined input sequence , i.e., successor(s, ) = {s: O* [(s, , , s) h]}. The set out(s, ) denotes the set of all output sequences (responses) that the FSM S can produce at state s in response to a defined input sequence , i.e. out(s, ) = { : sS [(s, , , s) h]}. The pair /, out(s, ), is an Input/Output (I/O) sequence at state s; if s is the initial state s1 then the pair / is an Input/Output (I/O) sequence of the FSM S. Given states s and s, the I/O sequence / can take (or simply takes) the FSM S from state s to state s if (s, , , s)h. A machine S is connected if for each s S there exists an input sequence that takes the FSM S from the initial state to state s. Given FSMs S = S, I, O, h, s1 and T = T, I, O, g, t1, the intersection S T is the largest connected submachine of FSM S T, I, O, f, s1t1 where (st,i,o,st) f (s,i,o,s) h (t,i,o,t) g.

Given two complete FSMs S = S, I, O, h, s1 and T = T,I,O,g,t1, state t of T and state s of S are non-separable, written t s, if for each input sequence I* it holds that out(t, ) out(s, ) , i.e., the sets of output responses to each input sequence at state t and at state s intersect; otherwise, states t and s are separable, written t ? s. For separable states t and s, there exists an input sequence I* such that out(t, ) out(s, ) = , i.e., the sets of output responses at states t and s to the input sequence are disjoint. In this case, is a separating sequence of states t and s, written t ? s, or simply separates t and s. The FSMs T and S are non-separable, written T S, if t1 s1. Otherwise, T and S are separable, written T ? S. If T and S are separable then a sequence that separates their initial states is a separating sequence of FSMs T and S, written T ? S. A separating sequence of the FSMs T and S is called shortest if any input sequence that separates T and S is not shorter than .

State t of the FSM T is a reduction of state s of the FSM S, written t s, if the set of I/O sequences of T at state t is a subset of that of S at state s; otherwise, t is not a reduction of state s, written t ? s. The FSM T is a reduction of FSM S if t1 s1, i.e., if the set of I/O sequences of T is a subset of that of S. If the sets of I/O sequences of the FSMs S and T coincide then these machines are equivalent. For deterministic complete FSMs, the reduction, equivalence, and non-separability relations coincide.

3. SEPERATING SEQUENCES: PROPERTIES, DERIVATION AND LENGTH

In this section some important properties of a separating sequence are established and an algorithm is proposed that derives a shortest separating sequence of two complete FSMs when such a sequence exists. Afterwards, the upper bound on the length of a shortest separating sequence is determined and shown to be reachable.

Let S = S, I, O, h, s1 and T = T,I,O,g,t1 be two complete separable FSMs. Given a shortest separating sequence i , i I, the sets of output responses of the FSMs S and T to intersect, while the sets of output responses of the FSMs S and T to i are disjoint. In other words, if S T = Q, I, O, f, q1, q1 = (s1,t1), then for every output sequence out(s1, ) out(t1, ) and for every state (s,t) where the I/O sequence / takes the intersection S T from the initial state, the transition under input i is not defined at the state (s,t). On the other hand, given a separating sequence i, if there exists an input sequence shorter than such that each state of the set successor(q1, ) is a reduction of an appropriate state of the set successor(q1, ), then i also separates the FSMs S and T, and thus, i is not a shortest separating sequence. Moreover, if is not the empty sequence and the set successor(q1,) includes the initial state q1 then i cannot be a shortest separating sequence, as the input i has to separate the initial states s1 and t1, and thus, i is a separating sequence of S and T. Based on the above observations, an algorithm is proposed that derives a shortest separating sequence of two separable FSMs (if such a sequence exists).

Algorithm 1 Deriving a Shortest Separating Sequence of Two Complete FSMs

Input: Complete FSMs S = S, I, O, h, s1 and T = T, I, O, g, t1

Output: A shortest separating sequence of FSMs S and T (if such a sequence exists)

Step 1. Derive the intersection S T. If the intersection is a complete FSM then the FSMs S and T are non-separable. END Algorithm 1.

Step 2. If the intersection S T is a partial FSM, then derive a truncated successor tree of the intersection S T. The root of this tree, which is at the 0th level, is the initial state (s1, t1) of the intersection; the nodes of the tree are labeled with subsets of states of the intersection. Given already derived j tree levels, j 0, a non-leaf (intermediate) node of the jth level labeled with a subset P of states of the intersection and an input i, there is an outgoing edge from this non-leaf node labeled with i to the node labeled with the subset of the i-successors of states of the subset P. A current node Current, at the kth level, k 0, labeled with the subset P of states, is claimed as a leaf node if one of the following conditions holds:

Rule 1: There exists an input i such that each state of the set P has no i-successors in the intersection S T;

Rule 2: There exists a node at the jth level, j < k, labeled with a subset R of states with the property: for each state (s',t') of R there exists a state (s,t) of P such that (s',t') (s,t).

Step 3. If none of the paths of the truncated tree derived at Step 2 is terminated using Rule 1 then FSMs S and T are non-separable. END Algorithm 1. Otherwise, if there is a leaf node, Leaf, labeled with the subset P of pairs of states such that for some input i, each pair of the set P has no i-successors, then a shortest sequence i where labels the path from the root of the tree to Leaf, is a shortest separating sequence of FSMs S and T.

Theorem 1. Given complete separable FSMs S and T over input alphabet I and output alphabet O, Algorithm 1 returns a shortest separating sequence of FSMs S and T.

Algorithm 1 can be used for deriving a separating sequence for two states s and s of a single FSM S = S, I, O, h, s1. In this case, FSMs S, I, O, h, s and S, I, O, h, s are the input of the algorithm.

Proposition 1. Given two complete separable FSMs S and T, |S| = n and |T|= m, the length of a shortest separating sequence of S and T is at most 2mn?1.

Proof: According to Algorithm 1, in the worst case, a path from the root to a leaf node Leaf, terminated using the termination Rule 1, contains each subset of states of the intersection except the initial state, since the set {q1}, q1 = (s1, t1), is at the 0th level of the truncated successor tree. Therefore, the length of the path does not exceed 2mn?1 - 1 and one more input is needed to separate states of the subset that labels the node Leaf, i.e., given two complete separable FSMs S and T, |S| = n and |T|= m, the length of a separating sequence of S and T is at most 2mn?1.

In the following, the upper bound 2mn?1 on length of a separating sequence is shown to be reachable. Given two integers n 1, m 1, the following algorithm, Algorithm 2, returns two complete separable FSMs S and T with n and m states which can be separated only with an input sequence of length 2mn?1. The idea behind Algorithm 2 is close to that of deriving a Moore lock FSM where an (appropriate) input sequence traverses all the states of the FSM while all other sequences (except the prefixes of ) take the FSM to the initial state or traverse a loop. In our case, both machine S and T are nondeterministic, have 2mn?1 inputs, and are derived in such a way that an appropriate input sequence of length 2mn?1 - 1 when applied at the initial state of the intersection S T =Q, I, O, f, q1, q1 = (s1, t1), traverses all the non-empty subsets of the set Q\{q1}. The last subset reached by the sequence contains a single state (s,t) where states s and t of machines S and T are separated with the tail 2(mn?1)th input of the input sequence. Any other input sequence (except the prefixes of ) of length up to 2(mn?1) -1 traverses a subset that contains the initial state of the intersection or traverses a superset of a set already traversed by a prefix of the input sequence and thus, is terminated according to Rule 2 of Algorithm 1 since there exists a node at the 0th level labeled with the subset {q1}.

Algorithm 2 Deriving Two FSMs S = S, I, O, h, s1 and T = T, I, O, g, t1, |S|= n and |T|=m, which can be separated only with an input sequence of length 2mn?1

Input: The integers n and m, the state sets S and T, |S|= n and |T|=m, the input set I = {i1, ..., ik}, k = 2mn?1 , and the output set O = {0, 1} Ч S Ч T

Output: Two complete FSMs S = S, I, O, h, s1 and T = T, I, O, g, t1, |S|= n and |T|=m, that can be separated only with an input sequence of length 2mn?1

Step 1: Enumerate all non-empty subsets of the set S Ч T\{(s1,t1)}= {(s1,t2),..., (sn,tm)} in such a way that each subset Mk+1 has no more states than the subset Mk, k = 1, ..., 2mn?1 - 1. The subset M1 = S Ч T\{(s1,t1)} and subsets Mk, k = 2mn?1 - mn, ..., 2mn?1 -1, are singletons. The tail subset Mk, k = 2mn?1 -1, is {(sn,tm)}.

Step 2: Build the transition relations h and g for both machines using the rules described below. Transitions with the inputs i1 and ik, k = 2mn-1, are treated in a special way.

Transitions with the input i1: Given an input i1, the relation h has all transitions of the set {(s1, i1, (1,s,t), s): s S, t T, (s,t) (s1,t1)}, while the relation g has all transitions of the set {(t1, i1, (1,s,t), t): s S, t T, (s,t) (s1,t1)}. For each state s S\s1 and t T\t1, the relation h has transitions (s, i1, (0,s1,t1), s1) and (s, i1, (1,s,t1), s1), while the relation g has transitions (t, i1, (0,s1,t1), t1) and (t, i1, (1,s1,t), t1) .

Transitions with the input ik, k = 2mn?1: This input should separate states sn and tm; therefore, the relation h has the transition (sn, ik, (1,s1,t1), s1), while the relation g has the transition (tm, ik, (0,s1,t1), t1). For each state s S\sn and t T\tm, the relation h has transitions (s, ik, (0,s1,t1), s1) and (s, ik, (1,s1,t1), s1) while the relation g has transitions (t, ik, (0,s1,t1), t1) and (t, ik, (1,s1,t1), t1).

Transitions with an input ik+1, 1 k 2mn-1 - 2 : Given input ik+1, 1 k 2mn-1 - 2, transitions are added to the relations h and g based on the subsets Mk and Mk+1 derived by explicit enumeration of all non-empty subsets of the set S Ч T\{(s1,t1)}. For each state s S, if there exists state t T such that the pair (s,t) Mk, the relation h has all transitions of the set {(s, ik+1, (1,s',t'), s'): (s',t') Mk+1}. If there exists state t T such that the pair (s,t) Mk, the relation h has all transitions of the set {(s, ik+1, (0,s,t), s1): (s,t) Mk}. In the same way, transitions of the FSM T under the input ik+1 are derived. For each state t T, if there exists a state s S such that the pair (s,t) Mk, the relation g has all transitions of the set {(t, ik+1, (1,s',t'), t'): (s',t') Mk+1}. If there exists a state s S such that the pair (s,t) Mk, the relation g has all transitions of the set {(t, ik+1, (0,s,t), t1): (s,t) Mk}.

In the following two propositions, some properties of the FSMs S and T returned by Algorithm 2 and of the intersection S T are established. Based on these properties Proposition 4 is provided that shows that S and T can only be separated with an input sequence of length 2mn-1.

Proposition 2. Given FSMs S and T returned by Algorithm 2 and two different states (s,t) and (s',t') of the intersection S T, it holds that (s,t) ? (s',t') and (s',t') ? (s,t).

Proof: In order to prove Proposition 2, we consider the two possible cases: Case-1 where none of the states (s,t) and (s',t') is the initial state (s1,t1) of S T, and Case-2 where state (s,t) or state (s',t') is the initial state (s1,t1) of S T.

Case-1: Let (s, t) (s1, t1), (s', t') (s1, t1). In this case, there exists a subset Mk, k = 1, ..., 2mn-1 - 2, that contains state (s,t) and does not contain state (s',t'). Therefore, by construction, (0,s',t') out((s',t'), ik+1) and (0,s',t') out((s,t), ik+1), i.e., the set of output responses at state (s',t') Mk to ik+1 has (0,s',t') while the set of output responses at state (s,t) Mk to ik+1 does not contain (0,s',t'). Thus, out((s',t'), ik+1) is not a subset of out((s,t), ik+1), i.e., (s',t') ?(s,t). Therefore, if (s,t) (s1,t1) and(s',t') (s1,t1), then (s',t') ? (s,t) and (s,t) ? (s',t').

Case-2: Let (s,t) (s1,t1) while (s',t') = (s1,t1). In this case, by construction, (0,s1,t1) out((s1,t1), ik+1), while (0,s1,t1) out((s,t), ik+1), k = 1, ..., 2mn-1 - 2, i.e., there exists an input symbol i such that the set of output responses at state (s1,t1) to i includes (0,s1,t1) while the set of output responses at state (s,t) to i does not contain (0,s1,t1). Thus, out((s1,t1), i) is not a subset of out((s,t), i), i.e., (s1,t1) ? (s,t). Moreover, there exists a subset Mk, k = 1, ..., 2mn-1 - 2, that does not contain state (s,t). Therefore, (0,s,t) out((s,t), ik+1), while (0,s,t) out((s1,t1), ik+1), i.e., the set of output responses at state (s,t) Mk to ik+1 includes (0,s,t) while the set of output responses at state (s1,t1) to ik+1 does not include (0,s,t). Thus, out((s,t), ik+1) is not a subset of out((s1,t1), ik+1), i.e., (s,t) ? (s1,t1).

Proposition 3. Given the intersection S T of FSMs S and T returned by Algorithm 2 and a subset Mj, j = 1, ..., 2mn?1 - 2 it holds that: a) if p > j + 1 then the ip-successor of Mj contains the initial state; b) if p = j + 1 then the ip-successor of Mj equals Mj+1; c) if p < j + 1 then the ip-successor of Mj contains the initial state or the subset Mp.

Proof:

(a): Let p > j + 1. Since p 1 > j, the subset Mp-1 has no more states than the subset Mj. Thus, there exists state (s,t) such that (s,t) Mj and (s,t)t Mp-1. By construction, given states s S and t T such that the pair (s,t) Mp-1, the relation h has a transition (s, ip, (0,s,t), s1) and the relation g has a transition (t, ip, (0,s,t), t1). Thus, in the intersection S T, there is transition from state (s,t) Mj to the initial state under input ip. Therefore, the ip-successor of Mj contains the initial state.

(b): Let p = j + 1. By construction, given states s S and t T such that the pair (s,t) Mj, the relation h contains all transitions of the set {(s, ij+1, (1,s',t'), s'): (s', t') Mj+1}, while the relation g has all transitions of the set {(t, i j+1, (1,s',t'), t'): (s', t') Mj+1}. Thus, the intersection S T has a transition from each state (s, t) Mj to each state (s', t') Mj+1 under input ij+1. Therefore, the ip-successor of Mj is Mj+1.

(c): Let p < j + 1. By construction, the i1-successor of Mj is the initial state. Let p > 1. If Mj Mp-1 , then there exists state (s,t) such that (s,t) Mj and (s,t) Mp-1. By construction, given states s S and t T such that the pair (s,t) Mp-1, the relation h contains all transitions of the set {(s, ip, (1,s',t'), s'): (s',t') Mp} while the relation g has all transitions of the set {(t, ip, (1,s',t'), t'): (s',t') Mp}. Thus, the intersection S T has a transition from each state (s,t) Mp-1 to each state (s',t') Mp under input ip. Therefore, if Mj Mp-1 , then the ip-successor of Mj contains the subset Mp .

If Mj Mp-1 = , then there exists state (s,t) such that (s,t) Mj and (s,t) Mp-1. In this case, there is transition from state (s,t) Mj to the initial state under input ip. Therefore, as it is shown in the proof of a), if Mj Mp-1 = then the ip-successor of Mj contains the initial state.

Proposition 4. The length of a shortest separating sequence of FSMs S and T returned by Algorithm 2 equals 2mn-1.

Proof. In order to prove Proposition 4, Algorithm 1 is applied for deriving a shortest separating sequence for the FSMs S and T returned by Algorithm 2, i.e., a truncated successor tree is derived for the intersection S T. The root of the tree that is at the 0th level is the initial state (s1,t1) of the intersection. The i1-successor of (s1,t1) is M1 = S Ч T\s1t1. Each other ij-successor of s1t1, j = 2, …,2mn-1, contains the initial state (Proposition 3) and thus, there is the only intermediate node at the 1st level labeled with M1; the edge from the root to this node is labeled by the input sequence i1.

By construction, each subset of the set S Ч T\{(s1,t1)} is reachable in the intersection from the initial state, and thus, the intersection is partial, since the transition under input ik, k = 2mn-1, is not defined at state (sn,tm). Moreover, according to Proposition 2, given two different states of the intersection S T, none of the states is a reduction of another state. Therefore, using Proposition 3 it can be shown by induction, that given j = 2, …, 2mn-1 -1, at the jth level there is the only non-leaf node labeled with the subset Mj, while all other nodes of the level are leaf nodes according to termination Rule 2. The path to the non-leaf node Mj at the jth level is labeled with the input sequence i1 i2 ...ij. Therefore, there exists the only non-leaf node of the truncated successor tree at the (2mn?1-1)th level labeled with the subset {sntm} and the path from the root to this node is labeled by the input sequence i1 i2 ... ik, k = 2mn?1-1. According to Theorem 1, the sequence i1 i2 ... ik-1 ik, k = 2mn?1, is a shortest separating sequence of FSMs S and T; the sequence has length 2mn-1.

Propositions 1 to 4 imply the following theorem:

Theorem 2. Given two complete separable FSMs S and T, |S| = n and |T|= m, the length of a shortest separating sequence of S and T is at most 2mn?1. Moreover, given integers n and m, n 1, m 1, there always exist separable FSMs S and T with n and m states which can be separated only with an input sequence of length 2mn?1.

4. AN APPLICATION EXAMPLE

In this section, a simple application example of Algorithm 2 is given for deriving machines S = S, I, O, h, s1 and T = T, I, O, g, t1 with |S| = n = 2 and |T| = m = 2. Afterwards, a shortest separating sequence of S and T is generated using Algorithm 1; the length of this sequence equals 2mn?1= 8.

Tables 1 and 2, shown below, represent the behavior relations of FSMs S and T. The state sets S = {a, b} and T = {1, 2}, the input set I = {i1, ..., ik}, k = 8, and the output set O = {0, 1} Ч S Ч T. The initial state of FSM S is a, the initial state of FSM T is 1. According to Proposition 4, the FSMs are separable and can be separated with an input sequence of length at least 2mn?1 = 8. For the sake of simplicity, in this example, a state tuple (s,t) of S Ч T is represented as st.

According to Algorithm 2, first, all the non-empty subsets of the set S Ч T\ a1= {a2, b1, b2} are enumerated in such a way that each subset Mk+1 has no more states than the subset Mk, k = 1, ...,7. Subset M1 = {a2, b1, b2}, while M2 = {a2, b1}, M3 = {a2, b2}, M4 = {b1, b2}, M5 = {a2}, M6 = {b1}, M7 = {b2}.

Given the input i1, transitions (a, i1, (1, a2), a), (a, i1, (1, b1), b), (a, i1, (1, b2), b), (b, i1, (0, a1), a), and (b, i1, (1, b1), a) are added to the relation h, while transitions (1, i1, (1, b1), 1), (1, i1, (1, a2), 2), (1, i1, (1, b2), 2), (2, i1, (0, a1), 1), and (2, i1, (1, a2), 1) are added to the relation g.

Given the input i2, transitions (a, i2, (1, a2), a) and (a, i2, (1, b1), b) are added to h since state a2 M1 and M2 = {a2, b1}, and transitions (b, i2, (1, a2), a) and (b, i2, (1, b1), b) are added to h since state b1 M1 and M2 = {a2, b1}. Transitions (1, i2, (1, b1), 1), (1, i2, (1, a2), 2) are added to g since state b1 M1 and M2 = {a2, b1}. Also, transitions (2, i2, (1, b1), 1) and (2, i2, (1, a2), 2) are added to the relation g since state a2 M1 and M2 = {a2, b1}. Moreover, the transition (a, i2, (0, a1), a) is added to h while the transition (1, i2, (0, a1), 1) is added to g since a1 M1. Transitions under the inputs i3, …, i7 are derived in a similar way.

The input i8 has to separate states b and 2; therefore, the transition (b, i8, (1, a1), a) is added to the relation h, while the transition (2, i8, (0, a1), 1) is added to the relation g. Transitions (a, i8, (0, a1), a) and (a, i8, (1, a1), a) are added to h and transitions (1, i8, (0, a1), 1), (1, i8, (1, a1), 1) are added to g.

Table 3 represents the behavior relation of the intersection S T. Algorithm 1 returns the tree given in Figure 1. Thus, a shortest input sequence that separates FSMs S and T is the sequence i1 i2 i3 i4 i5 i6 i7 i8 .

Table 1. FSM S Table 2. FSM T

S

a

b

T

1

2

i1

a / (1, a2)

b / (1, b1)

b / (1, b2)

a / (0, a1)

a / (1, b1)

i1

1 / (1, b1)

2 / (1, a2)

2 / (1, b2)

1 / (0, a1)

1 / (1, a2)

i2

a / (1, a2)

b / (1, b1)

a / (0, a1)

a / (1, a2)

b / (1, b1)

i2

1 / (1, b1)

2 / (1, a2)

1 / (0, a1)

1 / (1, b1)

2 / (1, a2)

i3

a / (1, a2)

b / (1, b2)

a / (0, a1)

a / (1, a2)

b / (1, b2)

a / (0, b2)

i3

2 / (1, b2)

2 / (1, a2)

1 / (0, a1)

2 / (1, b2)

2 / (1, a2)

1 / (0, b2)

i4

b / (1, b1)

b / (1, b2)

a / (0, a1)

b / (1, b1)

b / (1, b2)

a / (0, b1)

i4

1 / (0, a1)

1 / (0, b1)

1 / (1, b1)

2 / (1, b2)

i5

a / (0, a1)

a / (0, a2)

a / (1, a2)

i5

2 / (1, a2)

1 / (0, a1)

2 / (1, a2)

1 / (0, a2)

i6

b / (1, b1)

a / (0, a1)

a / (0, b1)

a / (0, b2)

i6

1 / (0, a1)

1 / (0, b1)

1 / (1, b1)

1 / (0, b2)

i7

a / (0, a1)

a / (0, a2)

b / (1, b2) a / (0, b2)

i7

2 / (1, b2)

1 / (0, a1)

1 / (0, a2)

1 / (0, b2)

i8

a / (0, a1)

a / (1, a1)

a / (1, a1)

i8

1 / (0, a1)

1 / (1, a1)

1 / (0, a1)

S T

a1

b1

a2

b2

i1

a2 / (1, a2)

b1 / (1, b1)

b2 / (1, b2)

a1 / (1, b1)

a1 / (1, a2)

a1 / (0, a1)

i2

a2 / (1, a2)

b1 / (1, b1)

a1 / (0, a1)

a2 / (1, a2)

b1 / (1, b1)

a2 / (1, a2)

b1 / (1, b1)

a2 / (1, a2)

b1 / (1, b1)

i3

a2 / (1, a2)

b2 / (1, b2)

a1 / (0, a1)

a2 / (1, a2)

b2 / (1, b2)

a2 / (1, a2)

b2 / (1, b2)

a2 / (1, a2)

b2 / (1, b2)

a1 / (0, b2)

i4

a1 / (0, a1)

a1 / (0, b1)

b1 / (1, b1)

b2 / (1, b2)

b1 / (1, b1)

b2 / (1, b2)

i5

a1 / (0, a1)

a2 / (1, a2)

a1 / (0, a2)

a2 / (1, a2)

i6

a1 / (0, a1)

a1 / (0, b1)

b1 / (1, b1)

a1 / (0, b2)

i7

a1 / (0, a1)

b2 / (1, b2)

a1 / (0, a2)

a1 / (0, b2)

i8

a1 / (0, a1)

a1 / (1, a1)

a1 / (1, a1)

a1 / (0, a1)

-

Table 3. FSM S T

Figure 1. The truncated tree derived using Algorithm 1

5. EXPERIMENTAL EVALUATION

In this section, we experiment with Algorithm 1 for deriving a shortest separating sequence of two complete FSMs in order to determine how often a separating sequence exists, the effect of varying the number of nondeterministic transitions on the existence of a separating sequence, length of a separating sequence and how often the upper bound of a separating sequence is reachable.

The experiments are based on 490,000 pairs of randomly generated complete nondeterministic FSMs with varying number of states n = 2, 4, 6, 8, 10, inputs |I| = 2, 4, 6…14, outputs |O| = 2, 4, 6, …, 14. For each combination (n, |I|, |O|), an integer num is selected as 20, 40, 60, 80 or 100 percent of the product n |I|. Afterwards, for each combination (n, |I|, |O|, num) four groups each of 100 pairs (M1, M2) of machines, each with n states, |I| inputs and |O| outputs are derived. Each machine M1 and M2 in a pair of a group is derived in the following way:

Initially, a complete deterministic FSM with n states, |I| inputs and |O| outputs is randomly derived. Afterwards, nondeterministic transitions are added to the FSM as follows. First, num transitions are randomly selected. Then, for each selected transition (s,i), t different transitions with initial state s and input i are added to the FSM. The number t is calculated as y percent of the product n |O|, where y is an integer randomly selected within the selected interval R. An interval R of integers is selected as one of the ranges (0 to 20), (20 to 40), (40 to 60) or (60 to 80). For each derived pair of machines, Algorithm 1 is applied and a shortest sequence that separates the given pair is determined (if such a sequence exists). Table 4 contains a summary of a part of all conducted experiments, where for all pairs with a given n (Column I), num (Column II) and interval R (Column III), all experiments with varying |I| and |O| are considered. The percentage of how many of these pairs have a separating sequence is shown in Column V. The maximum length of a shortest separating sequence, MaxLen, of all experiments in a row is shown in Column IV.

Table 4. A selected part of conducted experiments

I- Number of States, n

II- Num

III- Interval, R

IV- MaxLen

V- Percentage of Existence of a Separating Sequence

4

40

0..20

3

100

4

40

20..40

5

99.9

4

40

40..60

7

99.5

4

40

60..80

7

99

4

60

0..20

3

100

4

60

20..40

14

99.8

4

60

40..60

7

98.2

4

60

60..80

11

96.7

4

80

0..20

4

100

4

80

20..40

9

97.6

4

80

40..60

9

87.2

4

80

60..80

10

79.5

4

100

0..20

4

100

4

100

20..40

13

82.1

4

100

40..60

4

2.7

4

100

60..80

1

0.04

8

40

0..20

4

100

8

40

20..40

6

99.9

8

40

40..60

10

99.2

8

40

60..80

14

99.2

8

60

0..20

3

100

8

60

20..40

12

99.3

8

60

40..60

19

95.5

8

60

60..80

12

93.8

8

80

0..20

5

100

8

80

20..40

13

93.9

8

80

40..60

13

78.6

8

80

60..80

13

73.1

8

100

0..20

20

99.9

8

100

20..40

11

42.6

8

100

40..60

1

0.29

8

100

60..80

NA

0

Figure 2. Existence of a separating sequences with respect to Num

According to the conducted experiments the existence of a separating sequence mainly depends on the values of Num and R and is almost independent of the size (i.e. number of states, inputs and outputs) of the machines. Moreover, MaxLen and thus, on average, length of separating sequences are less than mn. Figure 2 depicts the relationship between the existence of a separating sequence and the values of Num and the intervals R. For all conducted experiments the upper bound 2mn-1 on the length of a separating sequence was never reached. It is worth noting that the generator used in the above experiments utilizes a random function when deriving transitions and it is interesting to study if similar results can be obtained when transitions are derived in another way; for example, if many transitions are derived in such a way that they take the machine to the initial state.

6. CONCLUSIONS

In this paper, an algorithm is proposed for deriving a shortest separating sequence of two complete FSMs (if such a sequence exists). Given arbitrary integers n and m, it is shown that there always exist FSMs S with n states and T with m states such that the length of a shortest separating sequence equals 2mn-1. However, according to the conducted experiments there exists a large class of pairs of FSMs with n and m states such that the length of a shortest separating sequence of a pair is less than mn. The experiments also show that the existence of a separating sequence of two FSMs significantly depends on the number of nondeterministic transitions in these FSMs. The algorithm proposed in the paper can also be used for deriving a separating sequence for three or more FSMs. All the results obtained in this paper are applicable for partial FSMs, i.e., differently from the equivalence relation, the upper bounds on the length of a separating sequence for complete and partial FSMs coincide.

Acknowledgements

The authors would like to thank Dr. Martin R. Woodward and the anonymous reviewers for their helpful comments on improving this manuscript. Moreover, the authors would like to extend their gratitude to Goubieva Joulia at Tomsk State University for implementing and experimenting with the proposed algorithms.

References

1. G.v. Bochmann, and A. Petrenko. Protocol testing: review of methods and relevance for software testing. Proc. International Symposium on Software Testing and Analysis, Seattle, 1994: 109-123.

2. S.T. Chanson, A.A.F. Loureiro, and S.T. Vuong. On tools supporting the use of formal description techniques in protocol development. Computer Networks and ISDN Systems 1993: 25.

3. R. Dorofeeva, K. El-Fakih, S. Maag, A. R.Cavalli, and N. Yevtushenko. Experimental evaluation of FSM-based testing methods. Proc. of the IEEE International Conference on Software Engineering and Formal Methods (SEFM05), Germany, 2005: 23-32.

4. R. Lai. A survey of communication protocol testing. The Journal of Systems and Software 2002; 62: 21-46.

5. D. Lee and M. Yannakakis. Principles and methods of testing finite state machines-a survey. Proceedings of the IEEE, 1996; 84(8): 1090-1123.

6. H. AboElFotoh, O. Abou-Rabia, and H. Ural. A Test Generation Algorithm for Protocols Modeled as Non-Deterministic FSMs. The Software Eng. Journal 1993, 8(4):184-188.

7. H. Kloosterman. Test derivation from non-deterministic finite state machines. Proceedings of the IFIP Fifth International Workshop on Protocol Test Systems, Canada, 1993: 297-308.

8. P. Tripathy, K. Naik, Generattion of adaptive test cases from nondeterministic Finite State models. IFIP Trans. C: Commun. System C-11, 1993:309-320.

9. G. Luo, A. Petrenko, and G. Bochmann. Selecting test sequences for partially specified nondeterministic finite state machines. Proc. 7th International Workshop on Protocol Test Systems, 1994.

10. G. Luo, G. Bochmann, and A. Petrenko. Test selection based on communicating non-deterministic finite-state machines using a generalized Wp-method. IEEE Transactions on Software Engineering 1994; 20(2):149-161.

11. R. Alur, C. Courcoubetis, and M. Yannakakis. Distinguishing tests for nondeterministic and probabilistic machines. Proc. the 27th ACM Symposium on Theory of Computing, 1995:363-372.

12. A. Petrenko, N. Yevtushenko, and G. V. Bochmann. Testing deterministic implementations from their nondeterministic specifications. Proc. 9th International Workshop on Protocol Test Systems, 1996; 125-140.

13. S.Yu. Boroday. Distinguishing Tests for Non-Deterministic Finite State Machines. Proc. IFIP TC6 11th International Workshop on Testing of Communicating Systems, 1998:101-107.

14. R. M. Hierons. Adaptive testing of a deterministic implementation against a nondeterministic finite state machine. The Computer Journal 1998; 41(5): 349-355.

15. I. Koufareva, N. Evtushenko, and A. Petrenko. Design of tests for nondeterministic machines with respect to reduction. Automatic Control and Computer Sciences, USA, 1998; 3.

16. R.M. Hierons. Using candidates to test a deterministic implementation against a non-deterministic finite state machine, The Computer Journal 2003; 46(3):307-318.

17. R.M. Hierons. Testing from a non-deterministic finite state machine using adaptive state counting. IEEE Transactions on Computers 2004; 53(10):1330-1342.

18. R.M. Hierons and H. Ural. Concerning the ordering of adaptive test sequences, Proc. 23rd IFIP International Conference on Formal Techniques for Networked and Distributed Systems (Lecture Notes in Computer Science, vol. 2767), Springer, 2003:289-302.

19. I. Hwang, T. Kim, S. Hong, and J. Lee. Test selection for a nondeterministic FSM. Computer Communications 2001; 24:1213-1223.

20. F. Zhang and T. Cheung, Optimal transfer trees and distinguishing trees for testing observable nondeterministic finite-state machines. IEEE Transactions on Software Engineering 2003; 29(1):1-14.

21. A. Petrenko, and N. Yevtushenko. Conformance tests as checking experiments for partial nondeterministic FSM. Proc. 5th International Workshop on Formal Approaches to Testing of Software (FATES 2005), 2005.

22. R. Miller, D. Chen, D. Lee, R. Hao. Coping with nondeterminism in network protocol testing. In Proceedings of the 17th IFIP International Conference on Testing of Communicating Systems, USA, 2005.

23. A.S. Tanenbaum, Computer Networks. Prentice-Hall, NJ, 1996.

24. A. Petrenko, N. Yevtushenko. Testing from partial deterministic FSM specifications. IEEE Trans. on Computers 2005; 54(9):1154-1165.

25. R. Milner. A Calculus of Communicating Systems. Lecture Notes in Computer Science, 1980; vol 92.

26. N. Spitsyna, V. Trenkaev, K. El-Fakih, N. Yevtushenko. FSM interoperability testing, Work In Progress: 23rd International Conference on Formal Techniques for Networked and Distributed Systems, 2003.

27. N. Spitsyna. FSM-based test suite derivation strategies for discrete event systems. Ph.D. Thesis, Tomsk State University, 2005: 1-158.

28. P. Starke, Abstract automata, American Elsevier, 1972: 3-419.


Подобные документы

  • The material and technological basis of the information society are all sorts of systems based on computers and computer networks, information technology, telecommunication. The task of Ukraine in area of information and communication technologies.

    реферат [29,5 K], добавлен 10.05.2011

  • Lines of communication and the properties of the fiber optic link. Selection of the type of optical cable. The choice of construction method, the route for laying fiber-optic. Calculation of the required number of channels. Digital transmission systems.

    дипломная работа [1,8 M], добавлен 09.08.2016

  • Сравнение эталонных моделей OSI, TCP. Концепции OSI: службы; интерфейсы; протоколы. Критика модели, протоколов OSI. Теория стандартов Дэвида Кларка (апокалипсис двух слонов). Плохая технология как одна из причин, по которой модель OSI не была реализована.

    реферат [493,1 K], добавлен 23.12.2010

  • Структурне проектування: data flow та entity-relation diagram. Об’єктно-орієнтоване проектування: use case, class, statechart, activity та sequence diagram. Верифікація та консолідація даних. Реалізація інформаційної системи для рекламного агентства.

    курсовая работа [3,4 M], добавлен 25.12.2013

  • International Business Machines (IBM) — транснациональная корпорация, один из крупнейших в мире производителей и поставщиков аппаратного и программного обеспечения. Прозвище компании — Big Blue. Основание IBM в период 1888—1924. Начало эры компьютеров.

    презентация [1023,3 K], добавлен 14.02.2012

  • Web Forum - class of applications for communication site visitors. Planning of such database that to contain all information about an user is the name, last name, address, number of reports and their content, information about an user and his friends.

    отчет по практике [1,4 M], добавлен 19.03.2014

  • Многоуровневая разветвлённая система сертификации инженеров по компьютерным сетям. Устройства сетевой безопасности. Крупные системы видеоконференций TelePresence. Программное обеспечение управления сетью. Универсальные шлюзы и шлюзы удалённого доступа.

    презентация [212,2 K], добавлен 26.11.2014

  • Модель взаимодействия открытых систем Open Systems Interconnection Reference Model. Основные особенности модели ISO/OSI. Характеристики физических сигналов, метод кодирования, способ подключения. Канальный уровень модели ISO/OSI. Передача и прием кадров.

    презентация [52,7 K], добавлен 25.10.2013

  • Сутність, типи, архітектура, управління, швидкість реакції та інформаційні джерела СВВ. Особливості документування існуючих загроз для мережі і систем. Контроль якості розробки та адміністрування безпеки. Спільне розташування та поділ Host і Target.

    реферат [28,0 K], добавлен 12.03.2010

  • Сущность понятия "комплексное число". Умножение, деление и сложение. Класс Number и два последующих Rational Number Operation и Complex Number. Схема наследования классов исключений. Тестирование программы. Схема работы приложения. Интерфейс программы.

    курсовая работа [607,3 K], добавлен 17.05.2015

Работы в архивах красиво оформлены согласно требованиям ВУЗов и содержат рисунки, диаграммы, формулы и т.д.
PPT, PPTX и PDF-файлы представлены только в архивах.
Рекомендуем скачать работу.