<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Managing test suites for services</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Universita ̈t Rostock, Institut fu ̈r Informatik</institution>
          ,
          <addr-line>18051 Rostock</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>When developing an existing service further, new functionalities can be added and existing functionalities can be changed or removed. Consequently, also test cases have to be added to or removed from the existing test suite. In this paper, we present an idea how a test suite can be adjusted to these changes. Thereby, we focus on modifications concerning the communication behavior of a service.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>Testing is an effective instrument to detect errors in software. However, for thorough
testing the number of required test cases increases rapidly with growing software
complexity. To reduce the effort for testing, test cases are generated and executed by tool
support as much as possible.</p>
      <p>
        In the paradigm of service-oriented computing (SOC) [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], modern software systems
are composed by a set of loosely-coupled and possibly geographic distributed services.
Each service implements an encapsulated, self-contained functionality and communicates
via message exchange over a well-defined interface with its partner services. In earlier
work [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] we presented a black box testing approach to test the communication behavior
for a single service.
      </p>
      <p>The development of a service is rarely finished with its initial release. In most cases,
maintenance follows. This includes both, correction (i.e., fixing of discovered bugs)
and integration of enhancements and new features. To adequately test the new service
version, also the test suite must be revised: New test cases have to be added and existing
test cases may be removed. Using the updated test suite, all (new) parts of the new
version are taken into account during testing. Further, one can be sure that a failed test
case indicates a bug in the implementation and is not caused by the specified changes.</p>
      <p>
        In this paper, we present an idea how a test suite, generated by our approach [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], can
be updated. For that purpose, unsuitable test cases are removed directly from the test
suite and test cases for new functionalities are created selectively. Consequently, it is
not necessary to again generate the complete test suite for a new service version. This
can be useful, because there are still some small manual steps involved which do not
need to be repeated for those test cases that can stay in the test suite. Especially, if only
small changes are specified and most parts of the test cases can remain in the test suite
the effort for test case generation can be reduced with this idea.
      </p>
      <p>
        The rest of this paper is organized as follows: Section 2 introduces basic formalisms.
Section 3 recalls the testing approach of [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Section 4 describes our idea to update a
test suite for a new service version. In Sect. 5, open issues are discussed, before Sect. 6
concludes the paper.
      </p>
    </sec>
    <sec id="sec-2">
      <title>Formalization</title>
      <p>
        Black box testing [
        <xref ref-type="bibr" rid="ref3 ref4">3,4</xref>
        ] means that test cases are created without consideration of
the actual code. For an automatic generation of a test case, a formal specification is
indispensable. To model the specified communication behavior of a service we use open
nets [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], a class of Petri nets. Thereby, the interface is specified by special input and
output places which represent the possible message types. In the model, we abstract
from the content of messages and focus on sending and receiving events only. They
are represented by transitions producing or consuming a token on the interface places
of the open net. Furthermore, an open net has an initial and a final marking. A final
marking distinguish desired end states from undesired deadlocks. To emphasize the data
abstraction we also speak of an abstract specification S for a given service S.
      </p>
      <p>Figure 1(a) shows the abstract specification Q of a simple online shop Q. The shop
expects a costumer to log in and to choose one of the payment methods: cash on delivery
(cod), credit card (cc), or bank transfer (bt). However, for setting the payment method
the login must be accepted first, otherwise the login is rejected and the user has to retry
to login. The final marking of this net is the marking [!] which only marks the place !:
the control flow reached its end and all message channels are empty.</p>
      <p>A partner P for a given service S is again a service that interacts deadlock freely
with S. That means, no deadlocks (except the final state) can occur in the composition
of the both services. To model the communication behavior of a partner P , we use again
open nets. Since we also abstract from the data, the net models an abstract partner P
of P .</p>
      <p>As an example we consider a partner R for the service Q (cf. Fig. 1(a)). Its abstract
version R is depicted in Fig.1(b). To check deadlock freendom between Q and R it is
sufficient to compose their abstract versions Q and R . For this purpose, we only need
to merge interface places with the same label. In the composed system, these merged
(a) Q
(b) R
(c) OGQ
interfaces place become to ordinary places. In our example the composition of Q and
R is free of deadlocks (except the final marking).</p>
      <p>
        The set of all partners of a given service S can be characterized by its operating
guideline OGS [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Formally, an operating guideline is an annotated service automaton.
That is a finite state automaton which edges are labeled with sending or receiving events
and states are annotated with a Boolean formula. The labels determine which events
of the partner may occur in a certain situation and the Boolean formulas defines which
combinations thereof are allowed. Each service P belonging to the set characterized by
an operating guideline OGS fulfills the following requirements: First, the reachability
graph of the abstract version P is a subgraph of OGS (including an initial state). Further,
each node n of the reachability graph satisfies the Boolean formula of its corresponding
state in OGS . The interested reader is referred to [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. If a services P is characterized
by an operating guideline OGS then we also say: P matches with OGS . Operating
guidelines can be generated from abstract specifications using the tool Wendy1 [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
      </p>
      <p>Figure 1(c) depicts the operating guideline OGQ of the abstract specification Q
(see Fig. 1(a)). In the graphical representation of operating guidelines, sending events
are preceded by \!" and receiving events are preceded by \?". Initial states have an
incoming arc from nowhere. Final states are double-lined. Since the reachability graph
of R is a subgraph of OGQ (see the bolded part of OGQ ) and the Boolean formulas
of the “touched” states are fulfilled, R is characterized by OGQ ; that is, R is a partner
of Q.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Testing Communication Behavior</title>
      <p>To test whether the implemented service interacts correctly with its environment we
create partner services as test cases. As they are derived from the specification they
interact by design deadlock freely with the service under test (SUT). If, however, during
testing a deadlock still occurs, we can conclude that the implementation contains (at
least) one error.</p>
      <p>
        The generation of test cases for a service S bases on the operating guideline OGS .
As there is usually a high number of abstract partners characterized by OGS , it is not
recommended to take every partner for testing. But among the test cases there is some
redundancy, such that is possible to to select a subset without reducing the test suite’s
quality [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. That means, it is still possible to find all errors, that can be found using the
whole set of (abstract) partners. After we have selected the required abstract partners
from the operating guideline we have to fill the message content with test data, and
finally, transform them into “real” services. The latter can be done automatically by
tool support, e.g. by oWFN2BPEL2 [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] for generating a BPEL process. Data are not
integrated into the concept of operating guidelines at the current state. However, data for
sending messages can be generated randomly and then easily added to an abstract test
case. Therefore, only the message types need to be respected. More sophisticated data
have to create manually.
      </p>
      <sec id="sec-3-1">
        <title>1 Available at http://service-technology.org/wendy 2 Available at http://service-technology.org/owfn2bpel</title>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Adjust existing test suites to new specifications</title>
      <p>As already mentioned in the introduction, it can be required to modify an existing service
from time to time. By introducing enhancements and new features the specification is
changed. This entails existing test cases to become invalid. That makes the test suite
inconclusive. Further, after adding new functionalities, there are parts in the new version
of the service which are not taken into account by the old test suite.</p>
      <p>To ensure a thorough testing, the test suite needs to be revised. Instead of discarding
all old test cases and deriving a new test suite from the scratch, we aim to keep as much
old test cases as possible. This is desirable because the procedure for generating the
test case (see Sect. 3) is not fully automatic. Thus, this strategy helps to reduce the
manual effort. Further, it is reasonable to use the same data in the remaining test cases.
By generating test cases from scratch, these data information would be lost.</p>
      <p>First, we describe in the following how invalid test cases can be removed from the
test suite. Afterward, we suggest how the new test cases can be found.
Making the test suite conclusive. Integrating new functionalities can change the control
flow and with it the communication behavior such that existing test cases become
invalid. This is demonstrated by the following example. Figure 3 shows a modification
Qnew for the specification in Fig. 1(a): If the credit card (cc) is chosen as payment
method, a voucher is sent to the customer. Now, the composition of Qnew and R (see
Fig. 1(b)) contains a deadlock because the voucher cannot be received from R . When
testing the new version of the simple online shop with R the test fails even through the
implementation is correct. In converse, if the implementation is incorrect the test can
succeed.</p>
      <p>To achieve a conclusive test suite for the new specification we discard the invalid test
cases. They can be detected using the matching algorithm for operating guidelines (cf.
Sect. 2). For each test case we check whether it matches with the operating guideline of
the new specification. This can be done using the tool Cosme3. Non-matching test cases
are invalid and have to be removed. After this procedure we have a conclusive test suite.
Adding missing test cases. To cover new parts during testing, test cases have to be
added to the test suite. For a systematic approach we make the following
consideration: Let OGS be the operating guideline of a specification and OGSnew the operating
guideline of the new specification. Let TS be the set of test cases characterized of OGS
and TSnew be the set of the test cases characterized by OGSnew . When calculating the
difference TSnew nTS we get exactly the set of test cases for testing the new parts.</p>
      <p>
        Unfortunately, the result of the difference operation cannot be represented as an
operating guideline. Instead, it can be represented as an extended annotated service
automaton (EAA for short) [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. This kind of finite automata extends annotated service
automata (cf. Sect. 2) by a global Boolean formula. It constrains the combinations of
states in the EAA that have to be “touched” during matching. Further, the structure of
the Boolean formulas in the states is not restricted as much as in an operating guideline.
      </p>
      <p>
        Formally, an operating guideline can easily be transformed into an EAA by setting
the global Boolean formula to true; that is, there are no additional requirements for the
states. For EAAs all basic set operations (including the difference) are defined [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] and
supported by the tool Safira4 [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
      </p>
      <p>Thus, we are able to calculate the set TSnew nTS based from the corresponding
operating guidelines. The result is an EAA that characterizes the test cases to be added.</p>
      <sec id="sec-4-1">
        <title>3 Available at http://service-technology.org/cosme 4 Available at http://service-technology.org/safira</title>
        <p>In the next step, the (abstract) test cases needs to extract from the EAA and transformed
into executable test cases.
5</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Future Work</title>
      <p>
        The set of test cases to be added, can be only represented by EAAs, an extension of
operating guidelines. In contrast to operating guidelines, the extraction of test cases from
an EAA is a time-consuming task. In [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] we proved that this problem is NP-complete
in general. This is caused by the more complex Boolean formula (in comparison to the
operating guidelines). In future work, we intend to find a good heuristic such that the
selection is practicable for EAAs. Thereby, it can be useful that the EAA is resulted
by applying the difference operation to two operating guidelines. Thus, the boolean
formulas in the result are less complex, than it could be in an arbitrary EAA.
6
      </p>
    </sec>
    <sec id="sec-6">
      <title>Conclusion References</title>
      <p>In this paper, we presented a concept to manage test suites for services in an iterative
development process. With the contained test cases the communication behavior can be
tested thoroughly. We demonstrated how invalid test cases can be detected and removed
from the test suite and we principle show how new test cases can be added. Thereby,
most steps are supported by existing tools.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Papazoglou</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Agent-oriented technology in support of e-business</article-title>
          .
          <source>Commun. ACM</source>
          <volume>44</volume>
          (
          <issue>4</issue>
          ) (
          <year>2001</year>
          )
          <fpage>71</fpage>
          -
          <lpage>77</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Kaschner</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lohmann</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          :
          <article-title>Automatic test case generation for interacting services</article-title>
          .
          <source>In: Service-Oriented Computing 2008 Workshops. LNCS 5472</source>
          , Springer (
          <year>2009</year>
          )
          <fpage>66</fpage>
          -
          <lpage>78</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Beizer</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          :
          <article-title>Black-box testing: techniques for functional testing of software and systems</article-title>
          . John Wiley &amp; Sons, Inc., New York, NY, USA (
          <year>1995</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Black</surname>
          </string-name>
          , R.:
          <article-title>Managing the Testing Process: Practical Tools and Techniques for Managing Hardware</article-title>
          and
          <string-name>
            <given-names>Software</given-names>
            <surname>Testing</surname>
          </string-name>
          . Wiley Publishing (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Wolf</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Does my service have partners?</article-title>
          <source>LNCS T. Petri Nets and Other Models of Concurrency</source>
          <volume>5460</volume>
          (
          <issue>2</issue>
          ) (
          <year>2009</year>
          )
          <fpage>152</fpage>
          -
          <lpage>171</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Lohmann</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Massuthe</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wolf</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Operating guidelines for finite-state services</article-title>
          .
          <source>In: ICATPN 2007. LNCS 4546</source>
          , Springer (
          <year>2007</year>
          )
          <fpage>321</fpage>
          -
          <lpage>341</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Lohmann</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Weinberg</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Wendy: A tool to synthesize partners for services</article-title>
          .
          <source>In: PETRI NETS 2010. LNCS 6128</source>
          , Springer-Verlag (
          <year>2010</year>
          )
          <fpage>297</fpage>
          -
          <lpage>307</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Lohmann</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kleine</surname>
          </string-name>
          , J.:
          <article-title>Fully-automatic translation of open workflow net models into simple abstract BPEL processes</article-title>
          .
          <source>In: Modellierung</source>
          <year>2008</year>
          . Volume P-
          <volume>127</volume>
          of Lecture Notes in Informatics (LNI).,
          <string-name>
            <surname>GI</surname>
          </string-name>
          (
          <year>2008</year>
          )
          <fpage>57</fpage>
          -
          <lpage>72</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Kaschner</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wolf</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Set algebra for service behavior: Applications and constructions</article-title>
          .
          <source>In: BPM 2009. LNCS 5701</source>
          , Springer-Verlag (
          <year>2009</year>
          )
          <fpage>193</fpage>
          -
          <lpage>210</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Kaschner</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Safira: implementing set algebra for service behaviour</article-title>
          .
          <source>In: Proceedings of the 2nd Central-European Workshop on Services and their Composition</source>
          .
          <source>CEUR Workshop Proceedings</source>
          , CEUR-WS.org (
          <year>2010</year>
          )
          <fpage>49</fpage>
          -
          <lpage>56</lpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>