<!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>
      <journal-title-group>
        <journal-title>Symposium on Software Performance, November</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Experiences in Replicating an Experiment on Comparing Static and Dynamic Coupling Metrics</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Richard Müller</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Dirk Mahler</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Christopher Klinkmüller</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>BUSCHMAIS GbR</institution>
          ,
          <addr-line>Dresden</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>CSIRO Data61</institution>
          ,
          <addr-line>Sydney</addr-line>
          ,
          <country country="AU">Australia</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>ipoque GmbH</institution>
          ,
          <addr-line>Leipzig</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2021</year>
      </pub-date>
      <volume>0</volume>
      <fpage>9</fpage>
      <lpage>10</lpage>
      <abstract>
        <p>In software engineering, coupling metrics are used to assess the quality of a software system's architecture, especially its maintainability and understandability. On an abstract level, two types of coupling metrics can be distinguished: static metrics are solely based on source and/or byte code, and dynamic metrics also take observed run-time behavior into account. While both metric types complement each other, a recent study by Schnoor and Hasselbring suggests that these two types are correlated. This observation indicates that to a certain degree both metric types encode redundant information. In this paper, we replicate the original experiment using the same data but a diferent tool set. Our successful replication hence substantiates the original findings. Moreover, the summary of our experience provides valuable insights to researchers who want to ensure reproducibility and replicability of their experiments. Following open science principles, we publish all data and scripts online.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Software Metrics</kwd>
        <kwd>Monitoring</kwd>
        <kwd>Dynamic Analysis</kwd>
        <kwd>Static Analysis</kwd>
        <kwd>Open Science</kwd>
        <kwd>Replication</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        In software engineering, a common design principle for improving the quality of a system
architecture, especially its maintainability and understandability, is to ensure a high cohesion
within modules and a low coupling between modules [
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ]. Coupling metrics serve as indicators
for the degree to which this design principle is adhered to and thus for the quality of the
architecture. A fundamental metric is the coupling degree of a module which measures the
number of connections between a module and other system modules [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], for example, between
classes or packages. It can be restricted to certain kinds of connections, such as method
calls, types of member variables, or types of thrown exceptions. Depending on whether the
connections were derived via static analysis of source and/or byte code, or via dynamic analysis
of monitoring logs, coupling degrees (or metrics) are referred to as static or dynamic, respectively.
      </p>
      <p>
        Schnoor and Hasselbring [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] recently investigated the extent to which the information
provided by dynamic coupling metrics complements the information captured by static metrics,
and vice versa. To this end, they empirically analyzed coupling orders of modules for a specific
software system. That is, they compared rankings of system’s modules obtained by ordering
the modules with respect to a variety of static and dynamic coupling degrees. The observation
that rankings based on static coupling degrees are not statistically independent from rankings
based on dynamic coupling degrees led Schnoor and Hasselbring to the conclusion that the
information provided by both types of coupling degrees is related.
      </p>
      <p>
        In this paper, we replicate the experiment conducted by Schnoor and Hasselbring [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] to verify
the previously observed findings. While we rely on the input data provided by the authors and
follow their procedure for computing and comparing the coupling degrees, we apply a diferent
tool set to process and analyze the data. This change implies that we go beyond a reproduction
of the original experiment1. Additionally, we report our experiences from the replication study,
explicating challenges that we faced and that are of interest to researchers wanting to ensure
reproducibility and replicability of their experiments.
      </p>
      <p>
        In the remainder of the paper, we summarize the original experiment in Section 2. We then
outline our replication setup and results in Section 3 and discuss our experiences in Section 4.
Finally, Section 5 concludes the paper. Following open science principles [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], all scripts used in
this replication study are publicly available and can be executed online2.
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. Original Experiment</title>
      <p>
        Schnoor and Hasselbring [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] empirically examined the extent to which diferent coupling
degrees provide similar information. For this purpose, they investigated Atlassian Jira3, a
commercial issue tracking system, in a series of four experiments. Each experiment spanned
a period of four weeks in which the system was actively used by students participating in a
mandatory programming course and in which data reflecting its runtime behavior was collected.
Note that the experiments relied on diferent versions of Jira, as Schnoor and Hasselbring
updated their Jira installation over time. However, while they used diferent versions across the
series of experiments, within each experiment the same version was applied. As a consequence,
the system’s architecture and runtime behavior varied, albeit slightly, across all experiments.
Table 1 briefly summarizes the main characteristics of the experiments.
      </p>
      <p>
        For each experiment, the same analytical procedure was followed. First, the static and
dynamic dependency graphs based on method calls were created for each experiment. The
static dependency graph was derived from a byte code scan of the corresponding Jira version
using BCEL4. By contrast, the dynamic dependency graph was derived from monitoring data
obtained at runtime during the experiment run with the monitoring tool Kieker [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. For each
experiment the monitoring data is provided as a publicly available dataset5,6,7,8. Each dataset
1We follow the terminology defined by the Association for Computing Machinery in https://www.acm.org/
publications/policies/artifact-review-and-badging-current.
      </p>
      <p>2https://github.com/softvis-research/coupling-metrics-replication
3https://www.atlassian.com/de/software/jira
4https://commons.apache.org/proper/commons-bcel/
5https://doi.org/10.5281/zenodo.3648094 (experiment 1)
6https://doi.org/10.5281/zenodo.3648228 (experiment 2)
7https://doi.org/10.5281/zenodo.3648240 (experiment 3)
8https://doi.org/10.5281/zenodo.3648269 (experiment 4)
yields compressed binary files (bin.xz) and a kieker file (.map) that contains the encrypted fully
qualified class names.</p>
      <p>Next, the coupling degrees were derived from the dependency graphs. The nodes of this
graph are program modules that are either classes or packages. The edges are aggregated
call relationships between the modules which can have weights representing the number of
calls. Depending on whether the coupling metrics take the weights into account, they are
referred to as weighted or unweighted. Please note that weighted metrics are omitted in the
static dependency graph as byte code is used and compiler optimizations may produce diferent
results. Furthermore, the direction of the calls is distinguished into outgoing and incoming calls
referred to as import and export coupling degree of a program module. The sum of import and
export coupling is referred to as combined coupling.</p>
      <p>
        Finally, the diferences of the coupling metrics were studied by comparing the ranking
obtained by ordering the program modules by their coupling degree using the Kendall-Tau
distance [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Values smaller than 0.5 indicate that the orders are closer together than expected
from two random orders. Distance values larger than 0.5 indicate the opposite. Considering
the above-mentioned measurements this results in 18 comparisons. The results were presented
using the following triple  :  1 ↔  2, where
•  is  or  expressing class or package coupling,
•  1 is  or  expressing whether the left-hand side analysis is static or (dynamic) unweighted,
•  2 is  or  expressing whether the right-hand side analysis is (dynamic) unweighted or
(dynamic) weighted.
      </p>
      <p>Schnoor and Hasselbring observed that the distance values for all pairs of compared rankings
were smaller than 0.5. Table 2 shows the obtained distance values for all four experiments.
These observations led the authors to the conclusion that coupling metrics obtained from static
and dynamic analysis encode similar information.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Replication</title>
      <p>
        The major steps of the replication process with corresponding inputs and outputs are summarized
in Figure 1. First, we used jQAssistant9 and its scanner plugins for Kieker [
        <xref ref-type="bibr" rid="ref7 ref8">7, 8</xref>
        ] and for Java
byte code [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] to process the Kieker traces provided by Schnoor and Hasselbring as well as
import
export
combined
average
import
export
combined
average
import
export
combined
average
import
export
combined
average
 :  ↔
      </p>
      <p>
        Jira’s Java byte code. This resulted in static and dynamic dependency graphs that contained
call relationships at method-level. We stored these graphs in a Neo4j database10. Second, we
aggregated the method calls at class- and package-level using custom Neo4j Cypher queries
specified as jQAssistant concepts [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. Third, we queried the graphs using Cypher to calculate
the import, export, and combined coupling degrees for each module. Finally, we compared the
coupling orders of the modules using the Kendall-Tau distance.
      </p>
      <p>We implemented steps 1 and 2 as batch scripts and steps 3 and 4 in a Jupyter notebook11. The
complete replication package including the batch scripts, the Jupyter notebook, and instructions
10https://neo4j.com/
11https://jupyter.org/
 :  ↔</p>
      <p>:  ↔   :  ↔ 
 :  ↔</p>
      <p>:  ↔   :  ↔ 
 :  ↔ 
 :  ↔</p>
      <p>:  ↔   :  ↔ 
 :  ↔ 
 :  ↔</p>
      <p>:  ↔   :  ↔ 
are provided in a GitHub repository and can be executed online, see Footnote 2.</p>
      <p>The results of the replication study are also shown in Table 2. The slight diferences between
the originally reported and the replicated values are probably due to the following two
circumstances. First, for unknown reasons a few classes that we discovered in the static dependency
analysis were not included in the static dependency graphs in the original experiment. However,
in the original experiment they were included in dynamic dependency graphs. Second, the
kieker files of experiment 1 and 2 contain an empty key-value pair in the the second line ($1=).
Here, a class might be missing in the published datasets that was contained in the original
experiments.</p>
    </sec>
    <sec id="sec-4">
      <title>4. Discussion</title>
      <p>Using our setup we were able to replicate the Kendall-Tau distances from the original experiment
and thus to substantiate the findings by Schnoor and Hasselbring. However, we faced some
challenges that exacerbated the replication. As we could eventually resolve all of them, not least
due to the help of the authors, we share our experiences in the following, hoping to contribute
to a better understanding of the level of detail with which experiments must be reported and
documented, in order to warrant their successful reproduction or replication.</p>
      <p>
        We encountered two challenges regarding the data that was available for the replication.
First, in addition to diferent Jira versions, Atlassian also distinguishes between diferent Jira
variants, for example, Jira Core and Jira Software. As information regarding the latter was
not specified in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], it was unclear which variant served as the basis for the static analysis.
Second, the names for packages, classes, and methods were pseudonymized in the publicly
available monitoring data. In more detail, the fully qualified Java names were replaced with
versions in which each of a name’s components was replaced with its hash. For example, a
fully qualified class name like package.subpackage.class$innerclass would be represented as
hash(package).hash(subpackage).hash(class$innerclass). On the one hand, we were not able
distinguish between class and inner class calls. On the other hand, the encryption also afected
the creation of module rankings, because the clear names were used as a secondary sorting
criterion in the original experiment. We thus had to decrypt the pseudonymized names in the
monitoring data and replaced them with the clear names from the Java byte code.
      </p>
      <p>
        Furthermore, a few challenges occurred during the analysis of the dependency graphs or
module rankings, respectively. First, we tested diferent Python implementations of the
KendallTau distance. All of them produced slightly diferent results, none of which were equal to the
results from the original experiment. In the end, we implemented our own calculation for the
Kendall-Tau distance. Second, not all call relationships between classes and packages were
actually considered by Schnoor and Hasselbring. Here, we found that the selection criteria
specified in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] did not yield the desired results. Yet, with the help of the authors, we were able
to determine that lambda method calls indeed needed to be excluded, but constructor calls had
to be included.
      </p>
      <p>Lastly, we identified a mistake in the documentation of the results of the original experiment.
In particular, Table 10 in the original paper shows the average export coupling degrees in the
four experiments. In case of the static dependency graphs these values are calculated using
the static weighted dependency graph. However, with the static analysis only the unweighted
coupling degrees were used in the original experiment. As we took the reported averages in
Table 10 to confirm the correctness of our replication setup, we first suspected a problem in our
setup, leading to significant verification eforts.</p>
      <p>In summary, we encountered a variety of challenges related to the available data, the applied
method, and the documented results. We would like to emphasize that none of the identified
challenges led to significant diferences between the original and our replicated results. However,
the investigation and rectification of these issues required time and efort, especially considering
that their efects influenced each other and that fixing one issue often revealed a new one.</p>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusion</title>
      <p>
        We successfully replicated the experiment from Schnoor and Hasselbring [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] which
empirically investigated diferences between static and dynamic coupling metrics. Hence, we could
substantiate the authors’ finding that static and dynamic coupling degrees are not statistically
independent. Furthermore, we discussed our experiences and, following open science principles,
made all scripts of the replication study available in a reproduction package that can be executed
online, see Footnote 2.
      </p>
      <p>In general, researchers who strive to ensure reproducibility or replicability should check
whether the empirical data, the applied methods, and the obtained results are suficiently well
described in the paper and/or documented elsewhere. In this regard, we greatly benefited from
the help of the authors and hence encourage researchers who plan a replication study to contact
the authors of the original study as early as possible. A specific recommendation arising from
our replication study is that researchers who pseudonomize or encrypt (parts of the) data should
review and explicate how this afects the reproduction or replication of their results.</p>
    </sec>
    <sec id="sec-6">
      <title>Acknowledgments</title>
      <p>We would like to thank the authors of the original experiment, Henning Schnoor and Wilhelm
Hasselbring, for publishing their data and for their great support with solving the challenges of
this replication study.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>I.</given-names>
            <surname>Candela</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Bavota</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Russo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Oliveto</surname>
          </string-name>
          ,
          <article-title>Using Cohesion and Coupling for Software Remodularization: Is It Enough?</article-title>
          ,
          <source>ACM Trans. Softw. Eng. Methodol</source>
          .
          <volume>25</volume>
          (
          <year>2016</year>
          ). doi:
          <volume>10</volume>
          . 1145/2928268.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>J.</given-names>
            <surname>Bogner</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Wagner</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Zimmermann</surname>
          </string-name>
          ,
          <article-title>Automatically Measuring the Maintainability of Service-</article-title>
          and
          <string-name>
            <surname>Microservice-Based Systems</surname>
          </string-name>
          :
          <article-title>A Literature Review</article-title>
          ,
          <source>in: Proceedings of the 27th International Workshop on Software Measurement and 12th International Conference on Software Process and Product Measurement</source>
          , IWSM Mensura '
          <volume>17</volume>
          ,
          <string-name>
            <surname>Association</surname>
          </string-name>
          for Computing Machinery, New York, NY, USA,
          <year>2017</year>
          , pp.
          <fpage>107</fpage>
          -
          <lpage>115</lpage>
          . doi:
          <volume>10</volume>
          .1145/3143434.3143443.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>H.</given-names>
            <surname>Schnoor</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Hasselbring</surname>
          </string-name>
          ,
          <source>Comparing Static and Dynamic Weighted Software Coupling Metrics, Computers</source>
          <volume>9</volume>
          (
          <year>2020</year>
          )
          <article-title>24</article-title>
          . doi:
          <volume>10</volume>
          .3390/computers9020024.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>D.</given-names>
            <surname>Mendez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Graziotin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Wagner</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Seibold</surname>
          </string-name>
          , Open Science in Software Engineering, in: M.
          <string-name>
            <surname>Felderer</surname>
            ,
            <given-names>G. H.</given-names>
          </string-name>
          <string-name>
            <surname>Travassos</surname>
          </string-name>
          (Eds.),
          <source>Contemporary Empirical Methods in Software Engineering</source>
          , Springer International Publishing, Cham,
          <year>2020</year>
          , pp.
          <fpage>477</fpage>
          -
          <lpage>501</lpage>
          . doi:
          <volume>10</volume>
          .1007/ 978-3-
          <fpage>030</fpage>
          -32489-6_
          <fpage>17</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>W.</given-names>
            <surname>Hasselbring</surname>
          </string-name>
          ,
          <string-name>
            <surname>A. van Hoorn</surname>
          </string-name>
          ,
          <article-title>Kieker: A monitoring framework for software engineering research</article-title>
          ,
          <source>Software Impacts</source>
          <volume>5</volume>
          (
          <year>2020</year>
          )
          <fpage>1</fpage>
          -
          <lpage>5</lpage>
          . doi:
          <volume>10</volume>
          .1016/j.simpa.
          <year>2020</year>
          .
          <volume>100019</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>L.</given-names>
            <surname>Briand</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K. E.</given-names>
            <surname>Emam</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Morasca</surname>
          </string-name>
          ,
          <article-title>On the application of measurement theory in software engineering</article-title>
          ,
          <source>Empirical Software Engineering</source>
          <volume>1</volume>
          (
          <year>1996</year>
          )
          <fpage>61</fpage>
          -
          <lpage>88</lpage>
          . doi:
          <volume>10</volume>
          .1007/BF00125812.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>R.</given-names>
            <surname>Müller</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Fischer</surname>
          </string-name>
          ,
          <source>Graph-Based Analysis and Visualization of Software Traces, in: 10th Symposium on Software Performance</source>
          , Würzburg, Germany,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>R.</given-names>
            <surname>Müller</surname>
          </string-name>
          , T. Strempel,
          <article-title>Graph-Based Performance Analysis at System-</article-title>
          and
          <string-name>
            <surname>Application-Level</surname>
          </string-name>
          ,
          <source>in: 11th Symposium on Software Performance</source>
          , Leipzig, Germany,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>R.</given-names>
            <surname>Müller</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Mahler</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Hunger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Nerche</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Harrer</surname>
          </string-name>
          ,
          <article-title>Towards an Open Source Stack to Create a Unified Data Source for Software Analysis and Visualization</article-title>
          ,
          <source>in: 6th IEEE Working Conference on Software Visualization</source>
          ,
          <string-name>
            <surname>IEEE</surname>
          </string-name>
          , Madrid, Spain,
          <year>2018</year>
          . doi:
          <volume>10</volume>
          .1109/VISSOFT.
          <year>2018</year>
          .
          <volume>00019</volume>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>