<!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>Mutation Testing for Microservices</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Distributed System Group, University of Bamberg</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>The microservice architectural style is currently of great interest both to research and industry. Since applications built by this style consist of many loosely coupled services, it is necessary to test their interactions by test suites. A crucial question is to decide which test cases are necessary and able to detect errors. A method to assure the quality of test cases is mutation testing. However, there are no mutation operators available yet which would enable the application of mutation testing specifically for microservices. This paper presents preliminary ideas for the creation of possible mutation operator whose application could help assure the quality of test cases by using mutation testing and therefore improve the quality of microservice systems.</p>
      </abstract>
      <kwd-group>
        <kwd>microservices</kwd>
        <kwd>mutation testing</kwd>
        <kwd>mutation operator</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Motivation</title>
      <p>
        Microservices have emerged as a trend over the last years and can be defined
as small, autonomous services that work together [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. The independence of the
components in a microservice architecture makes it possible to test them in
isolation. But testing on a higher level can become very difficult, especially for
larger systems with many connections between the services [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. Therefore, test
cases are needed that detect faults, which only emerge while using several services
in combination, as these faults are not detected while testing a single service.
      </p>
      <p>
        A method to evaluate the potential of a test case suite is mutation testing.
In general, mutation testing is a fault-based testing technique which creates a
faulty set of programs by seeding faults, which are often done by programmers,
into the program. A faulty program is called a mutant. By running the test suite
against each of the mutants, a mutant is “killed” as soon as its fault is detected.
The ’mutation score’ is the ratio of the detected faults over the total number of
seeded faults [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. It improves with every mutant killed.
      </p>
      <p>
        By mutating the program many faults can be produced at low cost [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. However,
mutation operators providing the rules to create faults are required in order to
create faulty programs. Using mutation operators can produce programs whose
faults are similar to those of real programs [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Therefore, mutation operators for
microservices could help to create mutants automatically which would facilitate
the assessment of the test case quality. Thus, quality and speed of test execution
could be improved resulting in a faster delivery for the customer.
      </p>
      <p>
        Mutation testing can be applied at unit level, integration level and specification
level [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. Since there are no mutation operators focusing on the microservice
architecture identified yet, we want to identify some mutation operators being
useful for microservices and evaluate them by applying them on a running system.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Research Outline</title>
      <p>For our future work, we plan to investigate several generic mutation operators
on unit, integration and specification level. We will consider existing mutation
operators and their suitability for microservices and define new mutation operators
adapted to the microservice architectural style to apply them to a technology
used in practice:
Unit level</p>
      <p>
        There are already many mutation operators denfied for specific programming
languages (e.g. C, Java or C# [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]). E.g. considering C, these mutation
operators change a statement, an operator, a variable or a constant [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
These mutation operators will probably be applicable for testing single
microservices depending on the language used. However, faults introduced by
using these mutation operators are not characteristic for microservices and
can be detected by testing services in isolation. Therefore, no
microservicespecific mutation operators can be introduced at unit level but established
mutation operators can be used to assess test suites for isolated microservices.
Integration level
      </p>
      <p>
        Mutation operators at the integration level are more interesting since
microservices can be interpreted as independent units which communicate by
using interfaces. Therefore, the integration level is a more promising area to
define characteristic mutation operators. As described in [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] or [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], interfaces
can be changed by removing or modifying parameters. This is a promising
approach, especially since a potential failure of a service can be simulated by
using this approach. Additionally, it would be possible to add a delay to the
delivery of messages in order to simulate a network congestion which would
force an alternative service to handle this message.
      </p>
      <p>Specification level</p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] Estelle Specifications are used to specify a system. Estelle Specifications
are a Formal Description Technique which describes a system hierarchically.
Some mutation operators are introduced which focus on the structure of the
system. Especially mutation operators modifying the control flow among
components could be transferred to microservices by considering the network
of services. By changing the control flow of services (e.g. parallel instead
of sequential execution of services and vice versa) faults might occur which
should be covered by test cases.
      </p>
      <p>Finally, the most promising mutation operators shall be applied to several
test case suites on a running system and be evaluated regarding their suitability
to assess the quality of test cases.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Agrawal</surname>
            , H.,
            <given-names>DeMillo</given-names>
          </string-name>
          , R.,
          <string-name>
            <surname>Hathaway</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hsu</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hsu</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Krauser</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Martin</surname>
            ,
            <given-names>R.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mathur</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Spafford</surname>
          </string-name>
          , E.:
          <article-title>Design of mutant operators for the c programming language</article-title>
          .
          <source>Tech. rep.</source>
          ,
          <string-name>
            <surname>Technical Report</surname>
          </string-name>
          SERC-TR-41-P, Software Engineering Research Center, Department of Computer Science, Purdue University, Indiana (
          <year>1989</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Andrews</surname>
            ,
            <given-names>J.H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Briand</surname>
            ,
            <given-names>L.C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Labiche</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          :
          <article-title>Is mutation an appropriate tool for testing experiments</article-title>
          ?
          <source>In: Proceedings of the 27th international conference on Software engineering</source>
          . pp.
          <fpage>402</fpage>
          -
          <lpage>411</lpage>
          . ACM (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>De Souza</surname>
            ,
            <given-names>S.D.R.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Maldonado</surname>
            ,
            <given-names>J.C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fabbri</surname>
            ,
            <given-names>S.C.P.F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>De Souza</surname>
            ,
            <given-names>W.L.</given-names>
          </string-name>
          :
          <article-title>Mutation testing applied to estelle specifications</article-title>
          .
          <source>In: System Sciences</source>
          ,
          <year>2000</year>
          .
          <source>Proceedings of the 33rd Annual Hawaii International Conference on</source>
          . pp.
          <fpage>10</fpage>
          -pp.
          <source>IEEE</source>
          (
          <year>2000</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Delamaro</surname>
            ,
            <given-names>M.E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Maldonado</surname>
            ,
            <given-names>J.C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mathur</surname>
            ,
            <given-names>A.P.</given-names>
          </string-name>
          :
          <article-title>Integration testing using interface mutation</article-title>
          .
          <source>In: Software Reliability Engineering</source>
          ,
          <year>1996</year>
          . Proceedings., Seventh International Symposium on. pp.
          <fpage>112</fpage>
          -
          <lpage>121</lpage>
          . IEEE (
          <year>1996</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Delamaro</surname>
            ,
            <given-names>M.E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Maldonado</surname>
            ,
            <given-names>J.C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pasquini</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mathur</surname>
            ,
            <given-names>A.P.</given-names>
          </string-name>
          :
          <article-title>Interface mutation test adequacy criterion: An empirical evaluation</article-title>
          .
          <source>Empirical Software Engineering</source>
          <volume>6</volume>
          (
          <issue>2</issue>
          ),
          <fpage>111</fpage>
          -
          <lpage>142</lpage>
          (
          <year>2001</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Do</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Elbaum</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rothermel</surname>
          </string-name>
          , G.:
          <article-title>Supporting controlled experimentation with testing techniques: An infrastructure and its potential impact</article-title>
          .
          <source>Empirical Software Engineering</source>
          <volume>10</volume>
          (
          <issue>4</issue>
          ),
          <fpage>405</fpage>
          -
          <lpage>435</lpage>
          (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Dragoni</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Giallorenzo</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lafuente</surname>
            ,
            <given-names>A.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mazzara</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Montesi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mustafin</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Safina</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          :
          <article-title>Microservices: yesterday, today, and tomorrow</article-title>
          .
          <source>In: Present and Ulterior Software Engineering</source>
          , pp.
          <fpage>195</fpage>
          -
          <lpage>216</lpage>
          . Springer (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Jia</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Harman</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>An analysis and survey of the development of mutation testing</article-title>
          .
          <source>IEEE Transactions on Software Engineering</source>
          <volume>37</volume>
          (
          <issue>5</issue>
          ),
          <fpage>649</fpage>
          -
          <lpage>678</lpage>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Newman</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Building microservices: designing fine-grained systems.</article-title>
          <string-name>
            <surname>O'Reilly Media</surname>
          </string-name>
          , Inc. (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>