<!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>Towards the Generation of Test Cases for Executable Business Processes from Classification Trees</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Thilo Schnelle</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Daniel Lu¨bke</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>FG Software Engineering, Leibniz Universita ̈t Hannover</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>innoQ Deutschland GmbH</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>innoQ Schweiz GmbH</institution>
          ,
          <country country="CH">Switzerland</country>
        </aff>
      </contrib-group>
      <fpage>15</fpage>
      <lpage>22</lpage>
      <abstract>
        <p>Testing executable business processes is essential when developing mission-critical process solutions. However, developers and testers are confronted with two major challenges: Keeping an overview of functional test coverage during test case creation and adopting existing test cases to process changes during maintainance. Our aim is to develop a generator-based approach that forces the tester to create a classification tree, which keeps track of functional test coverage. Using this classification tree the generator combines test fragments into test cases. Both the classification tree and the code fragments are easier to change than a complete test suite thereby allowing easier test case development and maintance.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Testing is essential for producing high quality and reliable software [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Testing
executable business processes that orchestrate services poses special challenges:
1. Processes are usually triggered by messages from external sources and
communicate to Web services. External sources can also include user facing
applications, like task managers. For sending messages to a process instance
and checking messages that are sent by process instances, all partner services
need to be mocked. This issue was already addressed by Mayer &amp; Lu¨bke [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]
and resulted in the open source tool BPELUnit.
2. Many different flows through the process model, covering both control-flow
and data-flow variants, have to be tested. This causes test cases to contain
many messages that are sent to the process. Therefore, BPELUnit test suites
consist of many lines of code. This amount of code decreases clarity and
makes it difficult to keep track of requirement coverage. Finding out whether
all requirements from the specification of the process are covered in a test
suite with thousands of lines of code poses a significant challenge.
3. A lot of test cases only diverge in later parts of the process. Therefore many
messages – especially in the beginning – are repeated often at the start
of different test cases. Applying even simple changes to the process can
therefore result in changes to every test case.
      </p>
      <p>In this paper we first give an overview over related work done in the field
of executable business process testing. Afterwards we propose a generator-based
approach that helps testers by reducing the aforementioned problems. We show
how the generator is used and the test models are created before we describe
two exploratory empirical studies that were conducted to validate and enhance
the presented concept before we conclude and give an outlook for future work.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Related Work</title>
      <p>
        The use of classification trees was proposed by Grochtmann et al [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. Their
classification-tree editor is used to systematically divide black-box tests up into
their requirements. Therefore one subtree per requirement is created and further
divided into concrete values that can appear for this requirement. Afterwards
they are able to automatically connect these pieces into test cases by picking
one value per requirement.
      </p>
      <p>
        Lu¨bke et al [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] proposed a way to measure test coverage for white-box testing
on executable business processes. This approach works by measuring which parts
of the code are executed. Therefore it differs from the black-box testing proposed
in this paper but can be an additional measure for increasing the quality of test
cases for processes.
      </p>
      <p>
        Another model-based approach by Lu¨bke and van Lessen [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] is based on
BPMN-modeled scenarios. This approach also addresses communication with
stakeholders and is not focused on testers only. However, no test coverage metrics
are included in this approach and also the problem of test case maintainance is
not addressed.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Classification Trees and Test Meta-Model</title>
      <p>Our approach is based on a classification tree as the main management artifact.
The structure of this classification tree and the attached technical information
is presented in this section. The data structured according to this metamodel is
used by a generator in order to create an executable BPELUnit test suite.</p>
      <p>The meta-model consists of two parts: First the formalization of the
classification tree (figure 1) and second the technical bindings attached to it (figure 2).</p>
      <p>The classification tree consists of several categories (first level child nodes)
that correspond to different requirements. The categories can have subcategories
and values. Values are the leafs of the tree. For example, an image processing
software might distinguish between different shapes and colors. Both are
independent requirements so they represent categories in the classification tree. Their
values are concrete shapes (rectangle, circle, . . . ) and colors (red, yellow, . . . ).
Possible test cases combine these, e.g. a first test case could use red rectangles
and a second yellow circles.</p>
      <p>For every test case only one value per category may be selected. The goal is
to have every value used in at least one test case but to create as few test cases
as necessary. Values that represent errors should always get their own test case
as errors may influence the execution of the process drastically.</p>
      <p>In the example three test cases are needed to cover all values because the
largest category (Shape) contains three values. The maximum number of test
cases is 6 (3 shapes times 2 colors).</p>
      <p>
        Although categories should be independent from each other, the pracical use
has shown that this strict requirement is very problematic in practice: Often
values are independent business requirements but are technically not exclusive.
Following the strict theoretical model leads to few categories with many values.
In order to allow more readable classification trees, we allow semi-depedent
categories and let the testers define conditions that prohibit certain combinations
of values. Such extensions have also been proposed by Lehmann &amp; Wegener [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>For every value there is a mapping that defines which test fragments are
added to a test case that contains this value. This part is called “technical
binding”.</p>
      <p>Mappings define which messages should be sent at specific points in the
execution of the test cases. They also define instances for variable slots. For
example in a message there might be a variable slot “purchase date”. Possible
instances for this slot are concrete dates from which one is chosen. There is also
the possibility to deactivate slots for messages and even complete partners of the
process, so that any communication to and from a specific service is disabled.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Generator Architecture &amp; Example</title>
      <p>We implemented a first version of a generator that follows the described
metamodel: The classification tree is edited and saved in a spreadsheet and the
technical binding information is stored in XML files. The generator reads all files
and produces an executable BPELUnit test suite.</p>
      <p>In the following, we discuss a simple model of an online shop as a business
process related example. Figure 3 shows the corresponding BPMN diagram.</p>
      <p>The classification for this online shop is shown in figure 4. There are three
independent categories with in total nine values. In contrast to classification trees
in “classical” software, the categories can represent process instance data (e.g.
message contents) or decisions made in the process (e.g. messages in deferred
choices.)</p>
      <p>Figure 5 shows the definition of a partner track, which corresponds to a
mocked service. For tracks there are slots defined into which message exchanges
can be inserted.</p>
      <p>These message exchanges are defined like the example in figure 6: The SOAP
service, binding and operation are defined like in a normal BPELUnit message
exchange but it may additionally contain variable slots. These are named places
for the insertion of test case specified data.</p>
      <p>This data is defined in variable instances like shown in figure 7. The variable
has the same name as the variable slot it can be inserted in.</p>
      <p>The connection between the two is made by mappings (see figure 8) and a
variable instance is chosen by its name to be inserted into the corresponding
variable slots. There are also message exchanges chosen to be inserted into
message slots of partner tracks. In addition the figure 8 shows how to deactivate
single slots or complete partner tracks if required.</p>
      <p>
        The generator is available as open source at GitHub4.
4 https://github.com/ThiloSchnelle/bpelunit-facet-classification-generator
In order to better understand the field of process testing and the implications
our approach might have, we conducted two empirical, exploratory studies: A
re-implementation of existing test cases of an executable business process taken
from an industry project and a small experiment with students.
The approach was applied to a process of the project Terravis [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], which had
a set of unit tests. These tests were re-implemented with the goal of exactly
reproducing the existing test suite in order to demonstrate that our approach
has the needed expressiveness for defining test cases.
      </p>
      <p>The size of the original test suite is much larger compared with the size of
source files for the generation approach: The original test suite contained 437
declarations of message exchanges that took 3663 lines of code (LOC) while the
source files for the generation only declare 53 (12%) message exchanges in 1428
(39%) LOC. The metrics show that the generator approach eliminated much
code duplication in the test suite.</p>
      <p>During the re-implementation two findings were made:
1. One test case of the existing unit tests used incorrect business data which
worked in the process because the data from this service call were not used
in this scenario. As a result, the process and the test suite was fixed. Because
the generator requires standardized message contents, this defect was found,
which is an advantage of our approach.
2. One test case that used anonymized data from production incidents was
found. The data was not harmonized with the other test cases. These
regression tests should probably not be re-implemented in real-life projects or
should be transformed to (re-)use already existing message contents and test
data. This also shows that the generator approach probably works best when
unified test data is used so that the different binding pieces can be easily
joined together and be reused.
5.2</p>
      <p>Student Experiment
The experiment took part in a university course. The participants started with no
webservice knowledge. They learned to model, implement and test executable
business processes. Their task was to test two example processes: One with
BPELUnit and one with the presented generator. Afterwards, the students
voluntarily answered a questionaire.</p>
      <p>Students on average created 2.89 test cases with pure BPELUnit compared
to 1.67 test cases with the generator. Some found working with the generator
to be faster in the long run and the additional effort to be small. Others found
the additional effort big and felt slowed down. The majority judged that the
generator is complicated but also increases the overview of the test coverage.</p>
      <p>We think that the time and the experience the participants had were not
sufficient for the additional complexity introduced by the generator to pay off.
This is why developing test cases was slower with the generator. On the other
hand an important task of the generator - increasing the overview over test
coverage - has been valued by the participants.</p>
      <p>From the feedback it also became clear that better tool support is needed.
As of now there is no GUI and XML files need to be written manually. This is
why we expect better productivity when tooling is in place.
6</p>
    </sec>
    <sec id="sec-5">
      <title>Conclusions and Outlook</title>
      <p>In this paper we proposed a generator-based approach to testing executable
business processes. An initial version of the meta-model and a generator have
been developed and has been open sourced. The toolchain has been tried initially
in an industrial project.</p>
      <p>Moreover, an exploratory student experiment has provided further necessary
research and development directions: Especially the missing editor support seems
to influence the development speed of the students negatively. Additional tool
support needs to be provided and an empirical validation has to be made for it.</p>
      <p>
        Conceptually, the generator-based approach offers the possibility to generate
missing test cases by combining different, yet unused combinations of values of
the classification tree. One possible algorithm to explore has been presented by
Cohen et al [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Research with “traditional” software systems has shown that
combining all possible values of two attributes with each other yields the highest
cost-usage benefits [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Further studies need to show whether these findings are
also valid for executable business processes.
      </p>
      <p>We will follow up on the open research questions and will especially look
at the efficiency (how many defects have been found and comparison between
classification tree coverage and code coverage) and would like to join with other
academic and industrial partners to further enhance and validate our approach.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Berli</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          , Lu¨bke,
          <string-name>
            <surname>D.</surname>
          </string-name>
          , Mo¨ckli, W.:
          <article-title>Terravis - large scale business process integration between public and private partners</article-title>
          . In: Plo¨dereder, E.,
          <string-name>
            <surname>Grunske</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schneider</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ull</surname>
            ,
            <given-names>D</given-names>
          </string-name>
          . (eds.) Lecture Notes in Informatics (LNI),
          <source>Proceedings INFORMATIK 2014</source>
          . vol. P-
          <volume>232</volume>
          , pp.
          <fpage>1075</fpage>
          -
          <lpage>1090</lpage>
          . Gesellschaft fu¨r Informatik e.V.,
          <string-name>
            <surname>Gesellschaft</surname>
            <given-names>fu</given-names>
          </string-name>
          ¨r Informatik e.V. (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Cohen</surname>
            ,
            <given-names>D.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dalal</surname>
            ,
            <given-names>S.R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fredman</surname>
            ,
            <given-names>M.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Patton</surname>
            ,
            <given-names>G.C.</given-names>
          </string-name>
          :
          <article-title>The AETG system: An approach to testing based on combinatorial design</article-title>
          .
          <source>IEEE Transactions on Software Engineering</source>
          <volume>23</volume>
          (
          <issue>7</issue>
          ),
          <fpage>437</fpage>
          -
          <lpage>444</lpage>
          (
          <year>1997</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3. D. Richard Kuhn,
          <string-name>
            <given-names>Dolores R.</given-names>
            <surname>Wallace</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.M.G.J.:</surname>
          </string-name>
          <article-title>Software fault interactions and implications for software testing</article-title>
          .
          <source>IEEE Transactions of Software Engineering</source>
          <volume>30</volume>
          (
          <issue>6</issue>
          ) (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Grochtmann</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>Test case design using classification trees</article-title>
          .
          <source>In: Proceedings of STAR 94</source>
          . pp.
          <fpage>93</fpage>
          -
          <lpage>117</lpage>
          (
          <year>1994</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Lehmann</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wegener</surname>
          </string-name>
          , J.:
          <article-title>Test Case Design by Means of the CTE XL</article-title>
          .
          <source>In: Proceedings of the 8th European International Conference on Software Testing, Analysis &amp; Review (EuroSTAR</source>
          <year>2000</year>
          ), Kopenhagen, Denmark (
          <year>2000</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6. Lu¨bke, D.:
          <article-title>Test and Analysis of Service-Oriented Systems, chap</article-title>
          .
          <source>Unit Testing BPEL Compositions</source>
          . Springer (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7. Lu¨bke, D., van Lessen,
          <string-name>
            <surname>T.</surname>
          </string-name>
          :
          <article-title>Modeling Test Cases in BPMN for Behavior-Driven Development</article-title>
          .
          <source>IEEE Software Sep/Oct</source>
          <year>2016</year>
          ,
          <fpage>17</fpage>
          -
          <lpage>23</lpage>
          (Sep/Oct 2016)
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8. Lu¨bke,
          <string-name>
            <given-names>D.</given-names>
            ,
            <surname>Singer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            ,
            <surname>Salnikow</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.</surname>
          </string-name>
          :
          <article-title>Calculating BPEL Test Coverage through Instrumentation</article-title>
          .
          <source>In: Workshop on Automated Software Testing (AST</source>
          <year>2009</year>
          ),
          <string-name>
            <surname>ICSE</surname>
          </string-name>
          <year>2009</year>
          (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Mayer</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          , Lu¨bke, D.:
          <article-title>Towards a BPEL Unit Testing Framework</article-title>
          .
          <source>In: TAV-WEB '06: Proceedings of the 2006 Workshop on Testing, Analysis, and Verification of Web Services and Applications</source>
          , Portland, USA. pp.
          <fpage>33</fpage>
          -
          <lpage>42</lpage>
          . ACM Press, New York, NY, USA (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>