<!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>Knowledge-aware Recommender System for Software Development</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Phuong T. Nguyen</string-name>
          <email>phuong.nguyen@univaq.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Juri Di Rocco</string-name>
          <email>juri.dirocco@univaq.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Davide Di Ruscio</string-name>
          <email>davide.diruscio@univaq.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Università degli studi dell'Aquila Via Vetoio</institution>
          <addr-line>2 - 67100 L'Aquila</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Open source software (OSS) forges contain rich data sources that are useful for the development process. We promote techniques and tools for providing open source developers with innovative features aiming at obtaining improvements in terms of development efort, cost savings, developer productivity. Our work is a coherent paradigm that facilitates multiple recommendations to assist software developers in diferent phases of the development process. In the scope of this paper, we introduce a graph-based representation to encode in a homogeneous manner diferent aspects of the OSS ecosystem. Furthermore, we develop a knowledge-aware recommender system for providing developers with suitable API function calls. An initial evaluation on real datasets shows that the system is able to produce relevant API calls.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>INTRODUCTION</title>
      <p>Open source software (OSS) is computer software available in
source code being provided under a license that allows users to
study, change, and improve the code free of charge. There are
several high-quality and mature projects which deliver stable and
welldocumented products. Most OSS forges (e.g., GitHub, BitBucket,
and SourceForge) typically sustain vibrant expert and user
communities which in turn provide decent levels of support both with
respect to answering user questions as well as to repairing reported
software bugs. In this sense, developing a new software system by
making use of existing open source components reduces
development efort and thus being beneficial to the whole software life
cycle.</p>
      <p>
        However, properly exploiting such foundations poses several
challenges including the miscellaneousness of resources and the
huge information space that impedes efective mining.
Developers need to deal with data coming from diferent sources, such as
Source code, Q&amp;A systems, bug reports, API documentation,
tutorials, just to mention a few [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. The mining of the diferent data
sources necessitates at least the following activities: searching for
candidate components that can be suitably reused, evaluating and
comparing them, and adapting the selected components to fit the
specific requirements of the new system being developed. Given the
circumstances, it is impossible to exploit the underlying knowledge
without suitable machinery.
      </p>
      <p>Knowledge-aware and Conversational Recommender Systems (KaRS) Workshop 2018
(co-located with RecSys 2018), October 7, 2018, Vancouver, Canada.
2018. ACM ISBN Copyright for the individual papers remains with the authors. Copying
permitted for private and academic purposes. This volume is published and copyrighted
by its editors..</p>
      <p>
        Within the EU H2020 CROSSMINER1 project, we aim at building
a thorough framework for supporting OSS developers. In particular,
we design and implement tools that automatically curate data from
large OSS forges in order to feed dedicated recommendation engines.
The augmented tools are provided in the form of an advanced
Eclipse-based IDE, which instantly monitors developers’ activities
and triggers alerts as well as produces intelligent recommendations.
To this end, our proposed framework consists of the following main
functionalities [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]:
• recommending sets of similar projects with regards to various
requirements, such as external dependencies, application
domain, or API usage by employing various similarity
algorithms. The similar projects help developers learn how to
implement the given project at an early stage;
• suggesting artifacts that have been incorporated in similar
projects, e.g. a list of external libraries [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] or code snippets
[
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. These artifacts can then be directly embedded into the
current project;
• prompting code snippets that demonstrate how an API is
utilized in practice. The recommended snippets help developers
gain a deeper insight into the usage of the API;
• suggesting external information sources, e.g. technical
documents, tutorials, discussions, etc., related to the code being
developed. For example, given an API, it is necessary to find
external posts to understand how other developers use the
API [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ];
• External libraries evolve over the course of time, which
impose change on the depending projects. Thus, it is necessary
to notify developers and suggest possible amendments to
preserve program compatibility.
      </p>
      <p>In order to mine the external and explicit knowledge sources to
feed the recommendation engines, the key point is to find a suitable
model to represent the intrinsic relationships among several OSS
artifacts. Furthermore, as input data comes from various sources, a
conventional recommender system that deals with a fixed type of
data cannot be applicable to the context of mining OSS
repositories. We come across with the graph model to encode the semantic
among artifacts and we employ a knowledge-aware recommender
system to exploit cutting-edge recommendation technologies for
mining software repositories. Since a knowledge-aware
recommender system incorporates the underlying knowledge available
at OSS repositories, it is expected that it can produce
recommendations that fit well to developers’ need.</p>
      <p>
        This paper presents an approach to support software
development by means of a knowledge-aware recommender system. We
model the OSS ecosystem using a Knowledge Graph to enable the
computation of similarities and giving recommendations [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. As a
proof of concept, we present a concrete use case by exploiting the
Knowledge Graph to provide an important functionality: API
function calls recommendation. To validate the proposed approach, we
perform an evaluation on two datasets of Java projects curated from
the Maven repository. The remainder of the paper is organized as
follows. Section 2 presents the Knowledge Graph and
recommendation techniques. The use case for recommending API function calls
is introduced in Section 3. We recall some related work in Section 4.
The paper discusses future work and concludes in Section 5.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>THE PROPOSED RECOMMENDER SYSTEM</title>
      <p>This section introduces the recommender system we are defining in
the context of the CROSSMINER project for supporting developers
that have to develop new systems by reusing existing open source
components. Section 2.1 presents a graph-based representation of
diferent artifacts that are involved when developing open source
software. Section 2.2 presents the conceived recommendation
techniques that rely on the proposed representation model.
2.1</p>
    </sec>
    <sec id="sec-3">
      <title>A Knowledge Graph for the OSS ecosystem</title>
      <p>
        We propose a representation model to capture the intrinsic
implications among various artifacts of the OSS ecosystem [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. By means
of a Knowledge Graph [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], we incorporate both human (such as
developers, users) and non-human factors (such as source code,
and libraries) into a homogeneous representation. In such graph, a
node represents either a person, or an artifact, such as a library, an
API function call, and a directed edge represents the relationship
between them. Table 1 explains all the relationships that we define
in our current implementation [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. The vocabularies can also be
augmented upon additional features of input data, even though our
definition seems to cover the most prevailing relationships.
      </p>
      <p>
        For explanatory purpose, we introduce a Knowledge Graph in
Figure 1. The graph encodes several relationships and interactions
among various OSS artifacts. For instance, with develops and
commits, we are able to represent the fact that two developers dev1
and dev2 take part in the development of source code belonging to
two projects project1 and project2. Similarly, the edge extends
dictates that two classes iClass1.java and iClass2.java are an
instance of AbstractClass.java, they both extend a same
abstract class and thus sharing common functionalities. The graph
structure facilitates similarity computation, which is a building
block for several recommendation algorithms [
        <xref ref-type="bibr" rid="ref4 ref6">4, 6</xref>
        ]. For example,
the similarity between iClass1.java and iClass2.java can be
inferred by considering two edges namely extends and invokes.
The two nodes are indirectly connected through other nodes API1
and AbstractClass.java and their similarity can be computed by
means of several graph algorithms [
        <xref ref-type="bibr" rid="ref12 ref13">12, 13</xref>
        ].
      </p>
      <p>The Knowledge Graph also sustains other types of mining to
support OSS developers. Take as an example, in Figure 1 the
StackOverlfow 2 post Post1 mentions code snippets containing two function
calls API1 and API2 from external libraries via the edge contains.
In practice, this a communication between users discussing the
usage of API1 and API2. In this sense, it might be worthwhile to</p>
      <sec id="sec-3-1">
        <title>2https://stackoverflow.com/</title>
        <p>recommend Post1 to the developer of iClass2.java, i.e. dev2 as
this class invokes both API function calls. Such recommendation
is helpful for developers when they work on the related function
calls, since it provides a deeper insight into the corresponding APIs.
Since the related knowledge is already encoded in the graph, we are
able to compute the similarity between Post1 and iClass2.java.
Eventually, the recommendation engine can present to the
developer a list of StackOverflow posts that are relevant to the source
code being developed.</p>
        <p>In this sense, we see that the adoption of a Knowledge Graph
paves the way for the deployment of recommender systems which
can address the underlying knowledge contained in OSS forges.
It is possible to transform the relationships among humans and
non-human artifacts into a mathematically computable format,
which then facilitates various types of calculations. The definition
of a proper representation model is a preparatory phase to other
developments, including several types of recommendations. It is
worth noting that the creation of a knowledge graph for OSS forges
is not trivial as we need to properly analyze both source code
and metadata to mine the encoded relationships and eventually
represent them in a homogeneous scheme. In the following section,
we discuss the possibility of exploiting the Knowledge Graph for
supporting OSS developers.
2.2</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Recommendation techniques</title>
      <p>
        We investigate recommendation techniques that are applicable
to the context of mining software repositories. A
collaborativeifltering recommender system exploits a two-dimensional matrix to
represent the relationships between users and items and computes
missing ratings [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ]. A user’s preference towards a prospective
item is predicted by means of preferences from similar users [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
The collaborative-filtering technique is applicable to mining OSS
repositories, as long as suitable interpretation can be conceived.
For instance, if we consider projects as customers, and libraries as
products, then it is possible to exploit the collaborative-filtering
technique to recommend third-party libraries. Following this scheme,
we successfully developed a system for recommending third-party
libraries which obtains a superior performance compared to a
wellestablished baseline [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ].
      </p>
      <p>
        The conventional collaborative-filtering technique is not
applicable to the situation when additional features are present. Given that
the preference of a user changes depending on the context where
the decision is made, the rating matrix is extended to three
dimensions, i.e user, item, and context. Incorporating context into the
computation process brings in a new level of recommender systems,
so called context-aware recommender systems [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Considering a
customer who needs recommendations on what additional products
should be put into the shopping cart, the intuition is to
collaboratively deduce the presence of prospective items from those that
have been purchased by similar customers in comparable contexts [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
In mining OSS repositories, a context-aware collaborative-filtering
technique can be used if we find suitable interpretation of contexts.
      </p>
      <p>A possible interpretation is as follows: if we use the
following mappings projects–contexts, developers–customers,
StackOverlfow posts–products , we can apply the context-aware
collaborativeifltering technique to suggest StackOverflow posts that may be
project2
includes
commits
hasSourceCode
develops
dev1</p>
      <p>Post1
extends
invokes
contains
contains</p>
      <p>API1
API2
extends
invokes
invokes
lib1
iClass1.java
iClass2.java
hasSourceCode
develops
s
t
a
r
s
dev2
helpful for a developer. The relationship among projects,
developers, and posts is represented in a 3-D matrix, where each slice is a
project, each row is a developer and each column is a post. A cell is
set to 1 if the developer consults the post when she develops the
project, otherwise it is set to 0. The context-aware
collaborativeifltering technique is then exploited to perform computation on the
3-D matrix to find missing items. Eventually, the recommendation
engine returns a list of posts that the developer may find useful.</p>
      <p>
        By exploiting the proposed approach, we succeeded in
developing two recommender engines for supporting OSS developers. In
[
        <xref ref-type="bibr" rid="ref13">13</xref>
        ], CrossSim has been implemented to present to developers a
list of similar projects given a project being developed. Similarly,
CrossRec is a system for recommending third-party libraries by
employing a dedicated OSS graph [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. In the following section, we
present another application of a Knowledge Graph to suggest API
function calls to be embedded to source code, taking into
consideration the current development context.
3
      </p>
    </sec>
    <sec id="sec-5">
      <title>A USE CASE: RECOMMENDING API</title>
    </sec>
    <sec id="sec-6">
      <title>FUNCTION CALLS</title>
      <p>
        Embedding well-established components developed by third parties
into source code is beneficial to the development process. Rather
than working from scratch, developers normally look for external
libraries that implement the desired functionalities and integrate
them into their existing projects [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. For such libraries, API
function calls are the entry point which allows one to invoke the ofered
functionalities. However, in order to exploit a library to implement
the required feature, developers need to consult various sources, e.g.
API documentation to see how a specific API instance is utilized in
practice [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]. Generally, from these external sources, there are texts
providing generic syntax or simple usage of the API, which may
be less relevant to the current development context as a whole. In
this sense, concrete examples of source code snippets that indicate
how specific API function calls are deployed in actual usage, would
come in handy [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ].
      </p>
      <p>
        Clustering has been considered as the de facto mechanism for
ifnding similar source code snippets, aiming to remove redundant
items [
        <xref ref-type="bibr" rid="ref18 ref8">8, 18</xref>
        ]. Nevertheless, a substantial amount of redundancy is
still witnessed by approaches that rely on clustering [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. In this
section, we introduce a solution to recommend API function calls by
exploiting the Knowledge Graph presented in Section 2.1. We aim
at providing developers with highly relevant API function calls by
carefully taking into account their development context. By means
of the Knowledge Graph, we are able to compute similarity and
eventually to feed the recommendation engine. First, we introduce
the following definitions:
• Method invocation (or invocation): a function call from an
external API;
• Method declaration (or declaration): a single source code unit,
i.e. a function/procedure, that contains various invocations
from diferent APIs;
• Software project (or project): a complete, standalone source
code unit that consists of a set of declarations to perform a
particular job.
      </p>
    </sec>
    <sec id="sec-7">
      <title>Predicting API function calls</title>
      <p>
        To predict additional API function calls to be integrated, we
derive a collaborative-filtering technique from the engine designed
for product recommendation [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Instead of recommending
products to customers with regards to context, we recommend
invocations to declarations, taking into consideration the given project.
In other words, by using the following mappings: projects–contexts,
declarations–customers, invocations–products, we are able to
transform the recommendation model applied for e-commerce systems
into mining API function calls. A tensor τ is utilized to capture the
intrinsic relationships among projects, declarations, and
invocations and eventually to produce recommendation.
      </p>
      <p>In tensor τ , each slice corresponds to a project, each row is a
declaration and each column is an invocation. τ is in the form
of τ ∈ Γn×m×k , where n, m, and k are the number of projects,
of declarations, and of invocations, respectively. Given a slice, a
cell is set to 1 if the declaration in corresponding row consists the
invocation in corresponding column, otherwise it is set to 0. Given
a project that needs recommendation on what items should be
integrated, the cells for missing invocations are set to −1.</p>
      <p>Figure 3 depicts the tensor representing a set of five OSS projects
P = (p1, p2, p3, p4, p5), with four declarations D = (d1, d2, d3, d4)
and seven invocations I = (i1, i2, i3, i4, i5, i6, i7) in total. In the
tensor, slices correspond to projects, rows are declarations and columns
correspond to invocations. For the sake of clarity, we only depict
a part of projects p1 and p3. In p3, there is no invocation i4 in
declaration d2, so the corresponding cell is set to 0. Meanwhile, by
declaration d3, invocation i3 is found, therefore the corresponding
cell is set to 1. Respectively p1 and d1 are the active project and
active declaration, i.e. the ones being developed. At the time of
consideration, it is not clear if d1 of p1 should include i2 and i3, thus
the corresponding cells are −1.</p>
      <p>
        There are a number of techniques available for computing
missing ratings, i.e. cells filled with −1, such as by using tensor
factorization as proposed in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. There, the original tensor is decomposed
into three sub-matrices and a central tensor, and the computation
of missing ratings is done by minimizing a loss function. In the
scope of this paper, we exploit the mechanism presented in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] to
predict the ratings since it allows for the exploitation of similarity
scores computed by means of the Knowledge Graph presented in
Section 1. A collaborative-filtering technique is then applied to
perform computation on the tensor to find missing items. We refrain
from recalling the technique due to space limitation and interested
p2
p1
declaration
1 ∗
      </p>
      <p>
        0 ∗
−1 −1
∗ ∗
invocation
project
readers are referred to [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] for greater detail. Eventually, the
recommendation engine returns a list of invocations that can be embedded
into the active declaration. In the following section, we present an
evaluation on Maven datasets to validate the performance of our
proposed approach.
3.2
      </p>
    </sec>
    <sec id="sec-8">
      <title>Evaluation Settings and Metrics</title>
      <p>
        A set of 3, 600 jar files from the Maven repository 3 has been
randomly collected and named as Dataset#1. From Dataset#1, for
projects with same prefix but diferent version numbers, we
randomly selected only one among them and discarded the others. The
removal resulted in a dataset consisting of 1, 600 and we named
it Dataset#2. Evaluation was performed on both datasets to see
how well the system recommends API invocations with respect to
diferent input data. By the evaluation, a dataset is split into two
independent parts, namely a training set and a testing set. In
practice, the items in the training data correspond to the OSS projects
that have been collected a priori. They are available at developers’
disposal, ready to be exploited for any mining purpose. Whereas,
each item in the testing data represents the project being
developed, or the active project. In this sense, an evaluation attempts
to mimic a real situation: the recommender system should produce
recommendations for a project based on the data available from a set
of existing projects. We opt for ten-fold cross validation [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] as it has
been popularly chosen for evaluating a model in Machine Learning.
By this method, the dataset is divided into 10 equal parts, so-called
folds. For each validation round, one fold is used as testing data and
the remaining 9 folds are used as training data.
      </p>
      <p>We simulate diferent stages of a development process to study
if our proposed system is applicable to a real deployment, by
considering a programmer who is developing a software project p. By
the evaluation, each item in the testing set is assumed to be p. To
this end, some parts of p are removed to mimic an actual
development. Given an original project p, the total number of method
declarations it contains is called ∆ . However for the testing, only
δ declarations (δ &lt; ∆ ) are used as input for recommendation and
the rest is discarded. In practice, this corresponds to the situation
when the developer already finished δ declarations, and she is now
working on the active declaration da . For da , the developer has just</p>
      <sec id="sec-8-1">
        <title>3https://mvnrepository.com/</title>
        <p>written π invocations. In practice, δ is low at an early stage and
increases over the course of time. Similarly, π is small when the
developer just starts working on da . The two parameters δ , π are
used to stimulate diferent development phases. In particular, we
consider the following configurations.</p>
        <p>Configuration C#1: δ = ∆ /2 − 1, π = 1. Almost a half of
the declarations are used as testing data and the other half are
removed, one declaration is selected as testing. For the testing
declaration, only one invocation is provided as query, and the rest is
used as ground-truth data which is called GT(p). This configuration
mimics a scenario when the developer is at an early stage of the
development process and therefore, only limited context data is
available for feeding the recommendation engine.</p>
        <p>Configuration C#2: δ = ∆ − 1, π = 1. One method declaration
is selected as testing data, all the remaining declarations are used
as training data. Similar to C#1, by the testing declaration only
one invocation is kept and all the others are taken out to use as
ground-truth data, i.e. GT(p). This represents the stage when the
developer almost finishes implementing the project.</p>
        <p>For a testing project p, the outcome of a recommendation process
is a ranked list of invocations, i.e. REC(p). It is expected that the
proposed system recommends items that eventually match with
those stored as ground-truth data GT(p). Normally, a developer
pays attention only to the top-N items, we use success rate and
accuracy as the evaluation metrics, considering N as the cut-of
value.</p>
        <p>
          Success rate. Given a set of P testing projects, this metric
measures the rate at which the recommendation engine can return at
least a match among top-N recommended items for every project
p ∈ P . The metric is formally defined as follows [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]:
|P |
where the function count() counts the number of times that the
boolean expression specified in its parameter is true.
        </p>
        <p>countp ∈P ( GT (p) T(∪rN=1RECr (p)) &gt; 0)</p>
        <p>
          Accuracy. Precision and recall are employed to measure
accuracy [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]. Precision@N is the ratio of the top-N recommended items
belonging to the ground-truth dataset:
        </p>
        <p>PrN=1 GT (p) T RECr (p)</p>
        <p>GT (p)
3.3</p>
      </sec>
    </sec>
    <sec id="sec-9">
      <title>Result Analysis</title>
      <p>Fig. 4(a) and Fig. 4(b) depict the success rate obtained for diferent
cut-of values, i.e. N = {1, 5, 10, 15, 20} for both configurations C#1
and C#2. We investigate the outcome by each dataset, i.e. Dataset#1
and Dataset#2 separately. Interestingly, there are no big diferences
in success rate between two configurations for all values of N by
both Dataset#1 and Dataset#2. Considering that by C#1 only a
half of the declarations are used as input for recommendation. This
demonstrates that the recommender system is able to generate
(1)
(2)
(3)
relevant recommendations also when only limited background data
is available, i.e. the developer doesn’t write much. By comparing the
Fig. 4(a) and Fig. 4(b) we see that the system produces better matches
given that more similar projects are available, as in Dataset#1
there exist similar projects with diferent version numbers. This
implies that the system can eficiently exploit background data for
recommendation.</p>
      <p>For a small cut-of value N , i.e. N = 1, that means when the
developer expects a very brief list of recommendations, the system
is still able to generate matches. For example, with Dataset#1, the
success rates of C#1 and C#2 are 72.30% and 72.80%, respectively.
Meanwhile, the outcome by Dataset#2 is much lower for both
conifgurations with N = 1, the success rates of C#1 and C#2 are 49.40%
and 50.10%, respectively. This implies that the performance of the
system improves substantially, given that more similar projects are
available.</p>
      <p>
        Next, we investigate the accuracy of both configurations by
varying the cut-of value N from 1 to 30 to get Precision@N and
Recall @N and sketching the Precision-Recall curves as shown in
Figure 5(a) and Figure 5(b). Since a curve being close to the
upper right corner represents better accuracy [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], we see that by
Dataset#1, a superior performance is obtained by configuration
C#2, i.e. when more background data is available for
recommendation in comparison to C#1. For Dataset#2, we witness the same
trend as by success rate, there are no distinctions between two
configurations C#1 and C#2. Considering both Figure 5(a) and
Figure 5(b), it can be seen that the overall accuracy for Dataset#1
is much better than that of Dataset#2. The maximum precision
and recall for Dataset#1 are 0.75 and 0.62, respectively. Whereas
the maximum precision and recall for Dataset#2 are 0.52 and 0.36,
respectively. This further confirms the fact that with more similar
projects, the system can provide better recommendations.
      </p>
      <p>
        We come to the conclusion that the proposed system is able
to provide relevant invocations with respect to diferent amount
of input data. Furthermore, it works efectively given that more
similar projects are available for recommendation. In practice, that
means it is expected that we can find as much complete projects
as possible since the more relevant background data we have, the
higher is the possibility we are able to mine relevant invocations.
We confirm the importance of the ability to search for similar OSS
projects [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ].
4
      </p>
    </sec>
    <sec id="sec-10">
      <title>RELATED WORK</title>
      <p>
        In [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], we presented a framework for supporting software
developers. The work introduces a preliminary version of a Knowledge
Graph to build a recommender system to provide third-party
libraries recommendation. Furthermore, it also proposes a set of
quality metrics for evaluating recommendation outcomes. Similarly,
in [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] a graph structure has been devised to compute similarity
among OSS projects. The authors in [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] exploit a knowledge graph
to build connections among several cells in a neural network. They
investigate how to extract and weight semantic features from the
knowledge graph to mitigate the cold user problem and eventually
to build a recommender system.
      </p>
      <p>Several studies have been conducted to solve the problem of
API function calls recommendation. MAPO was among the first
approaches that mine API usage patterns from client code projects</p>
      <p>PrN=1 GT (p) T RECr (p)</p>
      <p>
        N
and recall@N is the ratio of the ground-truth items appearing in
the top-N items:
72.30 72.80
[
        <xref ref-type="bibr" rid="ref18">18</xref>
        ]. The system analyzes source files to collect API usage
information and groups the API methods into clusters. Afterwards, it mines
API usage patterns from the clusters, ranks them according to the
similarity with developer context, and eventually recommends
complete API code snippets to developers. MUSE is a practical way to
recommend code examples related to a specific function [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. MUSE
parses source code to extract method usage, it simplifies examples
and detects clones to group similar code snippets. Furthermore,
it is able to rank recommendation outcomes according to various
characteristics, i.e. reusability, understandability and popularity.
Wang et al. proposed UP-Miner, aiming at reducing redundancy as
well as covering a wide range of API usage patterns from source
code [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ]. From an input API method, the technique automatically
ifnds all usage patterns and returns related code snippets. Both
clustering steps adopt the complete linkage technique and they rely
on sequence similarity functions. The experimental results show
that UP-Miner outperforms some baselines with respect to diferent
quality metrics.
      </p>
      <p>
        MLUP [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ] is an approach for mining multi-level API usage
patterns, which are clusters of methods that co-exist in a method
performing a specific functionality. This technique analyses the
frequency and consistency of co-usage relations among APIs from
diferent source code projects. MLUP is able to identify usage
patterns regardless of the variability of features and usage scenarios.
As input, the technique takes the source code and extracts the
relevant methods of the considered API. Each API public method is
characterized by a vector, where each entry corresponds to a client
method. The DBSCAN (Density-Based Spatial Clustering of
Applications with Noise) clustering technique is then used to group API
methods that are usually used together by projects.
      </p>
      <p>
        Most tools mentioned in this section use clustering as the only
way to identify relevant API function calls, with the aim of removing
redundant items [
        <xref ref-type="bibr" rid="ref18 ref8">8, 18</xref>
        ]. However, as shown in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], there is still a
substantial amount of redundancy by those approaches that rely
on clustering. Our proposed approach is novel since it attempts to
exploit the underlying semantic in source code and directly mines
API calls from similar projects and thus obtaining a promising
outcome as demonstrated in Section 3.
      </p>
    </sec>
    <sec id="sec-11">
      <title>5 CONCLUSIONS</title>
      <p>Aiming to assist developers in their development activities by
mining open source software repositories, we exploit a Knowledge
Graph to encode the relationships among several OSS artifacts
and build a knowledge-aware recommender system for providing
API function calls. An evaluation on two datasets curated from
the Maven repository shows that the proposed approach obtains
a good performance with respect to two quality indicators. We
believe that the deployment of a knowledge-aware recommender
system is beneficial to the context of software development. For
future work, we are going to thoroughly evaluate our proposed
approach by using other similar techniques as baseline, with the
consideration of more data.</p>
    </sec>
    <sec id="sec-12">
      <title>ACKNOWLEDGMENTS</title>
      <p>The research described in this paper has been carried out as part of
the CROSSMINER Project, EU Horizon 2020 Research and
Innovation Programme, grant agreement No. 732223.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>Gediminas</given-names>
            <surname>Adomavicius</surname>
          </string-name>
          and
          <string-name>
            <given-names>Alexander</given-names>
            <surname>Tuzhilin</surname>
          </string-name>
          .
          <year>2008</year>
          .
          <article-title>Context-aware Recommender Systems</article-title>
          .
          <source>In Proceedings of the 2008 ACM Conference on Recommender Systems (RecSys '08)</source>
          . ACM, New York, NY, USA,
          <fpage>335</fpage>
          -
          <lpage>336</lpage>
          . https://doi.org/10.1145/ 1454008.1454068
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Vito</given-names>
            <surname>Bellini</surname>
          </string-name>
          , Vito Walter Anelli, Tommaso Di Noia, and Eugenio Di Sciascio.
          <year>2017</year>
          .
          <article-title>Auto-Encoding User Ratings via Knowledge Graphs in Recommendation Scenarios</article-title>
          .
          <source>In Proceedings of the 2Nd Workshop on Deep Learning for Recommender Systems (DLRS</source>
          <year>2017</year>
          ). ACM, New York, NY, USA,
          <fpage>60</fpage>
          -
          <lpage>66</lpage>
          . https://doi.org/10.1145/ 3125486.3125496
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Annie</given-names>
            <surname>Chen</surname>
          </string-name>
          .
          <year>2005</year>
          .
          <article-title>Context-Aware Collaborative Filtering System: Predicting the User's Preference in the Ubiquitous Computing Environment</article-title>
          .
          <source>In Proceedings of LoCA'05</source>
          . Springer-Verlag, Berlin, Heidelberg,
          <fpage>244</fpage>
          -
          <lpage>253</lpage>
          . https://doi.org/10.1007/ 11426646_
          <fpage>23</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Tommaso</given-names>
            <surname>Di</surname>
          </string-name>
          <string-name>
            <surname>Noia</surname>
          </string-name>
          , Roberto Mirizzi, Vito Claudio Ostuni, Davide Romito, and
          <string-name>
            <given-names>Markus</given-names>
            <surname>Zanker</surname>
          </string-name>
          .
          <year>2012</year>
          .
          <article-title>Linked Open Data to Support Content-based Recommender Systems</article-title>
          .
          <source>In Proceedings of the 8th International Conference on Semantic Systems (I-SEMANTICS '12)</source>
          . ACM, 1-
          <fpage>8</fpage>
          . https://doi.org/10.1145/2362499.2362501
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Jaroslav</given-names>
            <surname>Fowkes</surname>
          </string-name>
          and
          <string-name>
            <given-names>Charles</given-names>
            <surname>Sutton</surname>
          </string-name>
          .
          <year>2016</year>
          .
          <article-title>Parameter-free Probabilistic API Mining Across GitHub</article-title>
          .
          <source>In Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering (FSE</source>
          <year>2016</year>
          ). ACM, New York, NY, USA,
          <fpage>254</fpage>
          -
          <lpage>265</lpage>
          . https://doi.org/10.1145/2950290.2950319
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>Guibing</given-names>
            <surname>Guo</surname>
          </string-name>
          , Jie Zhang, and
          <string-name>
            <surname>Neil</surname>
          </string-name>
          Yorke-Smith.
          <year>2013</year>
          .
          <article-title>A Novel Bayesian Similarity Measure for Recommender Systems</article-title>
          .
          <source>In Proceedings of the Twenty-Third International Joint Conference on Artificial Intelligence (IJCAI '13)</source>
          . AAAI Press,
          <fpage>2619</fpage>
          -
          <lpage>2625</lpage>
          . http://dl.acm.org/citation.cfm?id=
          <volume>2540128</volume>
          .
          <fpage>2540506</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>Alexandros</given-names>
            <surname>Karatzoglou</surname>
          </string-name>
          , Xavier Amatriain, Linas Baltrunas, and
          <string-name>
            <given-names>Nuria</given-names>
            <surname>Oliver</surname>
          </string-name>
          .
          <year>2010</year>
          .
          <article-title>Multiverse Recommendation: N-dimensional Tensor Factorization for Context-aware Collaborative Filtering</article-title>
          .
          <source>In Proceedings of the Fourth ACM Conference on Recommender Systems (RecSys '10)</source>
          . ACM, New York, NY, USA,
          <fpage>79</fpage>
          -
          <lpage>86</lpage>
          . https://doi.org/10.1145/1864708.1864727
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>Nikolaos</given-names>
            <surname>Katirtzis</surname>
          </string-name>
          , Themistoklis Diamantopoulos, and
          <string-name>
            <given-names>Charles</given-names>
            <surname>Sutton</surname>
          </string-name>
          .
          <year>2018</year>
          .
          <article-title>Summarizing Software API Usage Examples Using Clustering Techniques</article-title>
          . In Fundamental Approaches to Software Engineering, Alessandra Russo and Andy Schürr (Eds.). Springer International Publishing, Cham,
          <fpage>189</fpage>
          -
          <lpage>206</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Ron</given-names>
            <surname>Kohavi</surname>
          </string-name>
          .
          <year>1995</year>
          .
          <article-title>A Study of Cross-validation and Bootstrap for Accuracy Estimation and Model Selection</article-title>
          .
          <source>In Proceedings of the 14th International Joint Conference on Artificial Intelligence - Volume 2 (IJCAI'95)</source>
          . Morgan Kaufmann Publishers Inc., San Francisco, CA, USA,
          <fpage>1137</fpage>
          -
          <lpage>1143</lpage>
          . http://dl.acm.org/citation. cfm?id=
          <volume>1643031</volume>
          .
          <fpage>1643047</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Collin</surname>
            <given-names>McMillan</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>Denys</given-names>
            <surname>Poshyvanyk</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Mark</given-names>
            <surname>Grechanik</surname>
          </string-name>
          .
          <year>2010</year>
          .
          <article-title>Recommending Source Code Examples via API Call Usages and Documentation</article-title>
          .
          <source>In Proceedings of RSSE'10. ACM</source>
          ,
          <volume>21</volume>
          -
          <fpage>25</fpage>
          . https://doi.org/10.1145/1808920.1808925
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <surname>Laura</surname>
            <given-names>Moreno</given-names>
          </string-name>
          , Gabriele Bavota, Massimiliano Di Penta, Rocco Oliveto, and
          <string-name>
            <given-names>Andrian</given-names>
            <surname>Marcus</surname>
          </string-name>
          .
          <year>2015</year>
          .
          <article-title>How Can I Use This Method?</article-title>
          .
          <source>In Proceedings of the 37th International Conference on Software Engineering - Volume 1 (ICSE '15)</source>
          . IEEE Press,
          <fpage>880</fpage>
          -
          <lpage>890</lpage>
          . http://dl.acm.org/citation.cfm?id=
          <volume>2818754</volume>
          .
          <fpage>2818860</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <surname>Phuong</surname>
            <given-names>T.</given-names>
          </string-name>
          <string-name>
            <surname>Nguyen</surname>
          </string-name>
          , Juri Di Rocco, and Davide Di Ruscio.
          <year>2018</year>
          .
          <article-title>Mining Software Repositories to Support OSS Developers: A Recommender Systems Approach</article-title>
          .
          <source>In Proceedings of the 9th Italian Information Retrieval Workshop</source>
          , Rome, Italy, May,
          <fpage>28</fpage>
          -
          <lpage>30</lpage>
          ,
          <year>2018</year>
          . http://ceur-ws.
          <source>org/</source>
          Vol-
          <volume>2140</volume>
          /paper9.pdf
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>Phuong</surname>
            <given-names>T.</given-names>
          </string-name>
          <string-name>
            <surname>Nguyen</surname>
          </string-name>
          , Juri Di Rocco, Riccardo Rubei, and Davide Di Ruscio.
          <year>2018</year>
          .
          <article-title>CrossSim: Exploiting Mutual Relationships to Detect Similar OSS Projects</article-title>
          .
          <source>In 2018 44th Euromicro Conference on Software Engineering and Advanced Applications (SEAA)</source>
          .
          <volume>388</volume>
          -
          <fpage>395</fpage>
          . https://doi.org/10.1109/SEAA.
          <year>2018</year>
          .00069
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <surname>Luca</surname>
            <given-names>Ponzanelli</given-names>
          </string-name>
          , Gabriele Bavota, Massimiliano Di Penta, Rocco Oliveto, and
          <string-name>
            <given-names>Michele</given-names>
            <surname>Lanza</surname>
          </string-name>
          .
          <year>2014</year>
          .
          <article-title>Mining StackOverflow to Turn the IDE into a Self-confident Programming Prompter</article-title>
          .
          <source>In Proceedings of MSR 2014. ACM</source>
          ,
          <volume>102</volume>
          -
          <fpage>111</fpage>
          . https://doi. org/10.1145/2597073.2597077
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>M. A.</given-names>
            <surname>Saied</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Benomar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Abdeen</surname>
          </string-name>
          , and
          <string-name>
            <given-names>H.</given-names>
            <surname>Sahraoui</surname>
          </string-name>
          .
          <year>2015</year>
          .
          <article-title>Mining Multilevel API Usage Patterns</article-title>
          .
          <source>In 2015 IEEE 22nd International Conference on Software Analysis, Evolution, and Reengineering (SANER)</source>
          .
          <volume>23</volume>
          -
          <fpage>32</fpage>
          . https://doi.org/10.1109/ SANER.
          <year>2015</year>
          .7081812
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <surname>Badrul</surname>
            <given-names>Sarwar</given-names>
          </string-name>
          , George Karypis, Joseph Konstan,
          <string-name>
            <given-names>and John</given-names>
            <surname>Riedl</surname>
          </string-name>
          .
          <year>2001</year>
          .
          <article-title>Item-based Collaborative Filtering Recommendation Algorithms</article-title>
          .
          <source>In Proceedings of WWW '01. ACM</source>
          ,
          <volume>285</volume>
          -
          <fpage>295</fpage>
          . https://doi.org/10.1145/371920.372071
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>J.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Dang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Zhang</surname>
          </string-name>
          , K. Chen,
          <string-name>
            <given-names>T.</given-names>
            <surname>Xie</surname>
          </string-name>
          , and
          <string-name>
            <given-names>D.</given-names>
            <surname>Zhang</surname>
          </string-name>
          .
          <year>2013</year>
          .
          <article-title>Mining succinct and high-coverage API usage patterns from source code</article-title>
          .
          <source>In 2013 10th Working Conference on Mining Software Repositories (MSR)</source>
          .
          <volume>319</volume>
          -
          <fpage>328</fpage>
          . https://doi.org/10. 1109/MSR.
          <year>2013</year>
          .6624045
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <surname>Hao</surname>
            <given-names>Zhong</given-names>
          </string-name>
          , Tao Xie, Lu Zhang, Jian Pei, and
          <string-name>
            <given-names>Hong</given-names>
            <surname>Mei</surname>
          </string-name>
          .
          <year>2009</year>
          .
          <article-title>MAPO: Mining and Recommending API Usage Patterns</article-title>
          . In ECOOP 2009 -
          <string-name>
            <surname>Object-Oriented</surname>
            <given-names>Programming</given-names>
          </string-name>
          , Sophia Drossopoulou (Ed.). Springer Berlin Heidelberg,
          <fpage>318</fpage>
          -
          <lpage>343</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>