<!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 coverage criteria for serverless applications</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Stefan Winzinger</string-name>
          <email>stefan.winzinger@uni-bamberg.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Distributed System Group, University of Bamberg</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <fpage>39</fpage>
      <lpage>42</lpage>
      <abstract>
        <p>Serverless computing is a popular execution model where a cloud provider is responsible for the allocation of resources. Stateless serverless functions build the basis for a serverless application. The statelessness of the functions eases the scalability of the system. A serverless application is built by connecting the serverless functions with other services. Even though the behavior of the serverless functions is easy to test in isolation, the behavior emerging by their integration is hard to predict. Therefore, integration tests are necessary. However, there are no coverage criteria available yet for this specific class of applications making test case sets comparable. Therefore, we introduce characteristics and approaches which can be used for coverage criteria.</p>
      </abstract>
      <kwd-group>
        <kwd>Serverless Application</kwd>
        <kwd>FaaS</kwd>
        <kwd>Integration Testing</kwd>
        <kwd>Coverage Criteria</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Serverless computing is a popular computing model which is supported by the
established IT companies ([
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]). But there are also open source solutions
([
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]) available.
      </p>
      <p>
        Stateless serverless functions are used in a serverless application. The cloud
provider can easily scale them up if the workload increases. This is done by
the usage of stateless, mostly short-running functions whose degree of resource
concurrency can be adjusted automatically on function level [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. By connecting
them with each other or other resources, like instances of databases, a complex
application is created. However, the behavior emerging in such a complex system
is hard to test if the components are only tested in isolation. Making a platform
provider responsible for the execution of the serverless resources makes it even
harder to cover all relevant scenarios. Therefore, integration tests are needed
testing the behavior of resources used together.
      </p>
      <p>
        However, it is dificult to decide if a test case set is good enough or if new
test cases could improve the test quality if there is no possibility to compare test
cases. Therefore, coverage criteria are needed indicating the degree of coverage
and thus making them comparable. But no coverage criteria are available yet
focusing on the coverage of the specific class of serverless applications. Many
coverage criteria are available in literature (e.g., [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]) whereas there are no
criteria available yet focusing on serverless applications. Therefore, we plan to
introduce coverage approaches for specific serverless characteristics.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Approaches for Coverage Criteria</title>
      <p>In the following, we discuss characteristics of serverless applications and coverage
concepts which seem reasonable to be used for the creation of coverage criteria.
Services: The usage of diferent services, like serverless functions, databases or
interfaces, can be used as a coverage criterion by indicating the percentage of
called resources of these services. This would enforce the confidence that the
resources of the services are deployed correctly and work properly. A criterion
subsuming this one is the coverage of all connections between the resources. This
ensures that the communication between the resources works correctly, e.g., that
the used data format is interpreted correctly.</p>
      <p>Parallelism: Because of the parallelism of serverless applications resulting from
the scalability of the serverless functions, race conditions can occur if the same
data are accessed by at least two diferent workflows where at least one workflow
writes data. Coverage criteria checking these problems could evaluate if hot spots
of these conflicts are called in certain situations by the test case sets. Both the
parallel call of the same workflow and the parallel call of diferent workflows have
to be checked to fulfill a coverage criterion.</p>
      <p>Execution time: The execution time can vary depending on the hardware which
is assigned to a function. Functions are sometimes executed with more hardware
resources than what is assigned to them in their settings. This results in a
faster execution of the function. Therefore, diferent execution times have to be
considered if a function is tested.</p>
      <p>Functions which aren’t used for a while take longer to be executed which is
called “cold start”. By testing the application with diferent cold start delays,
potential efects of the cold start can be covered.</p>
      <p>Patterns using the time have to be defined and used as coverage criteria.
Thus, diferent kinds of errors can be revealed. Diferent execution times can
influence the workflow which can even provoke race conditions. But also errors
caused by a time out are possible.</p>
      <p>
        Access rights: Access rights assigned to serverless functions can also be used as
coverage criteria indicating the usage of the rights. Test cases must use each of
the assigned access rights. If no test cases can be created for the relevant rights
assigned, the necessity of the assigned access right has to be reconsidered.
Dataflow: Since the functions are stateless in a serverless application, their states
have to be persisted somewhere else. This is either in a data storage or within
the data passed from one resource to another. By applying well-known coverage
Towards coverage criteria for serverless applications
criteria like the coverage of certain code between the definition and the use of a
variable ([
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]) and transferring them to a serverless application, test case quality
could be improved.
      </p>
      <p>
        Workflow: By just considering the resources of the application and its order of
execution, diferent workflows are identified. These workflows can also be used
for the creation of coverage criteria by transferring known coverage criteria to
serverless applications. The coverage criteria to cover all paths suggested by [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ])
could be transferred to a coverage criteria requiring all workflows to be covered.
Errors: There are some errors which are specific for serverless applications whose
occurrence can be used for coverage criteria. Depending on the configuration and
the platform provider, each function has limited resources like memory and CPU
power which was assigned to it. Therefore, if the execution of a function takes
too much time or memory, the execution might throw an error and be restarted.
Therefore, test cases are needed covering these errors and their recovery scenarios.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Conclusion and Outlook</title>
      <p>In this paper, we suggested how coverage criteria for a serverless application can
be created by focusing on serverless-specific characteristics and applying known
concepts for these systems. Depending on the criteria used, diferent classes of
errors can be better revealed and prevented by testing.</p>
      <p>In our future work, we plan to create concrete coverage criteria for serverless
applications and to automate the test case generation by using a model describing
the serverless application. These test cases shall be optimized to the fulfillment
of serverless-specific coverage criteria. Furthermore, we want to support the tool
support to track these criteria. Thus, the quality of this specific class of complex
applications can be improved.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>AWS</given-names>
            <surname>Lambda</surname>
          </string-name>
          <article-title>(accessed January 9,</article-title>
          <year>2019</year>
          ), https://aws.amazon.com/lambda/
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Azure</surname>
          </string-name>
          <article-title>Functions (accessed January 9,</article-title>
          <year>2019</year>
          ), https://azure.microsoft.com/en-us/ services/functions/
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>Google</given-names>
            <surname>Cloud</surname>
          </string-name>
          <article-title>Functions (accessed January 9,</article-title>
          <year>2019</year>
          ), https://cloud.google.com/ functions/
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>IBM</given-names>
            <surname>Cloud</surname>
          </string-name>
          <article-title>Functions (accessed January 9,</article-title>
          <year>2019</year>
          ), https://www.ibm.com/cloud/ functions/
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>OpenFaaS</surname>
          </string-name>
          (
          <issue>accessed January 9</issue>
          ,
          <year>2019</year>
          ), https://github.com/openfaas
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>OpenLambda</surname>
          </string-name>
          (
          <issue>accessed January 9</issue>
          ,
          <year>2019</year>
          ), https://github.com/open-lambda
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Baldini</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Castro</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chang</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          , Cheng, P.,
          <string-name>
            <surname>Fink</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ishakian</surname>
          </string-name>
          , V., Mitchell, N.,
          <string-name>
            <surname>Muthusamy</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rabbah</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Slominski</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Suter</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Serverless computing: Current trends and open problems</article-title>
          .
          <source>In: Research Advances in Cloud Computing</source>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>20</lpage>
          . Springer Singapore (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Frankl</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Weyuker</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          :
          <article-title>An applicable family of data flow testing criteria</article-title>
          .
          <source>IEEE Transactions on Software Engineering</source>
          <volume>14</volume>
          (
          <issue>10</issue>
          ),
          <fpage>1483</fpage>
          -
          <lpage>1498</lpage>
          (oct
          <year>1988</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Huang</surname>
            ,
            <given-names>J.C.</given-names>
          </string-name>
          :
          <article-title>An approach to program testing</article-title>
          .
          <source>ACM Computing Surveys</source>
          <volume>7</volume>
          (
          <issue>3</issue>
          ),
          <fpage>113</fpage>
          -
          <lpage>128</lpage>
          (sep
          <year>1975</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Rapps</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Weyuker</surname>
          </string-name>
          , E.:
          <article-title>Selecting software test data using data flow information</article-title>
          .
          <source>IEEE Transactions on Software Engineering</source>
          SE-
          <volume>11</volume>
          (
          <issue>4</issue>
          ),
          <fpage>367</fpage>
          -
          <lpage>375</lpage>
          (apr
          <year>1985</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>