SlideShare a Scribd company logo
http://people.disim.univaq.it/diruscio/
davide.diruscio@univaq.it
@ddiruscio
FOCUS: A Recommender System for
Mining API Function Calls and
Usage Patterns
Davide Di Ruscio
Joint work with Phuong T. Nguyen, Juri Di Rocco, Lina Ochoa, Thomas Degueule, Massimiliano Di Penta
2ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Context
Related activities
• Searching for candidate components
• Evaluating a set of retrieved candidate components
to find the most suitable one
• Understanding how to use the selected components
• Monitoring the selected components
Development of new software systems
by reusing existing open source components
www.crossminer.org
@crossminer
eclipse.org/scava
3ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Mining and
Knowledge Extraction
Tools
Source code
Q&A systems
Bug Reports
API
Documentation
Tutorials
Configuration
Management Systems
Advanced IDEs
CROSSMINER: high-level view
Bringing to the domain of software development the notion of
recommendation systems that are typically used for popular e-commerce
systems to present users with interesting items previously unknown to
them
4ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Kinds of recommendation
Depending on the set of selected third-party libraries, the system is able to
recommend additional libraries that should be included in the project being
developed
Given a selected library, the system is able to suggest alternative ones that share
some similarities with the selected one
Depending on the set of selected libraries, the system shows API documentation
and Q&A posts that can help developers to understand how to use the selected
libraries
During the development, developers get recommendations about API function calls
and usage patterns that might be used
…
5ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Problem
“Which API methods should this piece of client code
invoke, considering that it has already invoked these
other API methods?”
6ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Explanatory example: method under development
7ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Explanatory example: method declaration
Method declaration (MD)
Method invocations (MI)
8ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Explanatory example: complete method declaration
9ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Explanatory example: quested recommendations
10ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Explanatory example: quested recommendations
List of API function calls:
• get, equal, where,
select, ...
11ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Explanatory example: quested recommendations
Usage patterns:
• Snippets of code
containing the
recommended
function calls
12ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
FOCUS
It recommends API FunctiOn Calls and USage patterns
It works on the basis of a context-aware collaborative-filtering system
13ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Recommend products to customers with similar preference
Image source: https://towardsdatascience.com/various-implementations-of-collaborative-filtering-100385c6dfe0
Collaborative-Filtering Technique
14ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Collaborative-Filtering Technique
University of L'Aquila 14
R1 R2 R3
c1 5 5 2
c2 3 3 4
c3 5 5 ?
Internal Meeting, 31 October 2017
User-item matrix: Ratings given to Pizza restaurants by customers
15ICSE 2019 – May 31, 2019 – Montréal, QC, CanadaUniversity of L'Aquila CROSSMINER Toulouse Meeting, 10-12 June 2018 15
Context-aware recommendation
16ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Context-aware recommendation
University of L'Aquila CROSSMINER Toulouse Meeting, 10-12 June 2018 16
Examples of context: day of the
week, hour of the day, weather
conditions, …
17ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Context-aware recommendation
University of L'Aquila CROSSMINER Toulouse Meeting, 10-12 June 2018 17
Predict the inclusion of additional invocations
18ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
FOCUS architecture
19ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
FOCUS architecture
20ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Code Parser
The available OSS repositories are mined to extract for each project:
- Method declarations
- Method invocations
- Field accesses
- Interface implementations
- Class extensions
- …
Rascal
Metaprogramming Language
https://www.rascal-mpl.org/
21ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Code Parser
The available OSS repositories are mined to extract for each project:
- Method declarations
- Method invocations
- Field accesses
- Interface implementations
- Class extensions
- …
Rascal
Metaprogramming Language
https://www.rascal-mpl.org/
22ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
FOCUS architecture
23ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Data encoder
Extracted method declarations and invocations of each project are
represented in a corresponding rating matrix
24ICSE 2019 – May 31, 2019 – Montréal, QC, CanadaUniversity of L'Aquila CROSSMINER Toulouse Meeting, 10-12 June 2018 24
Representation of Projects-MDs-MIs
3D user-item-context
ratings matrix
Mappings:
– contexts ←→ projects
– users ←→ declarations
– items ←→ invocations
25ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Similarity calculator
Given an active declaration in an active project, we find the subset of:
- the most similar projects
- and then the most similar declarations in that similar projects
26ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Similarity calculator: Projects and method declarations
Graph-based representation
of projects and invocations
The similarity of two projects
p and q is calculated by
considering their feature
vectors (TF-IDF)
The similarities among
methods declarations are
calculated using the Jaccard
similarity index
27ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
FOCUS architecture
28ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Recommendation engine: API function calls
Generation of a ranked list of API function calls
• Additional invocations for the active declaration are predicted by
computing the missing ratings
• Ranked list of invocations with scores in descending order
29ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Recommendation engine: API usage patterns
From the ranked list, top-N method invocations are used as query to
search for relevant declarations
Source code snippets containing the identified relevant declarations
are retrieved from the available source code base
30ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Evaluation
Assessing FOCUS capability to recommend API function calls
– Accuracy (precision and recall)
– Success rate
– Time performance
Comparing FOCUS with a state-of-the-art tool (PAM*)
Two dataset sources:
– More than 600 GitHub projects retrieved from Software Heritage
– A set of 3,600 jars retrieved from Maven Central
* Jaroslav Fowkes, Charles Sutton. Parameter-free probabilistic API mining across GitHub, Proceedings of the 24th ACM SIGSOFT
International Symposium on Foundations of Software Engineering (FSE 2016 )
31ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Evaluation process
Source Code
metadata
32ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Evaluation process: testing project
Total number of
declarations
Declarations that are kept
(the rest are discarded)
Total number of
invocations in a given
declaration
Invocations that are used
as query
33ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Evaluation process: testing project
Only the first
invocation is provided
as a query, and the rest
is used as ground-truth
data
Four invocations are
provided as a query,
and the rest is used as
ground-truth data
The first half of the
declarations is used as
testing data and the
second half is removed
C1.1 C1.2
The last method
declaration is selected as
testing and all the
remaining declarations
are used as training data
C2.1 C2.2
Four different configurations
34ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Evaluation key points
The performance of FOCUS relies on the availability of background data
– the system works effectively given that more OSS projects are available for
recommendation
Accuracy improves substantially when the query contains more invocations
Precision and recall for C1.1 and C1.2 on SH dataset Precision and recall for C1.1 and C1.2 on MV dataset
35ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Evaluation key points
A dataset consisting of only 200 projects has been considered
Leave-one-out cross-validation has been performed to exploit as much
as possible the projects available as background data, given a testing
project
PAM requires 9 seconds to provide each
recommendation while FOCUS just
needs 0.095 seconds
36ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
What’s next
Embedding FOCUS directly into the Eclipse IDE
– Under development in CROSSMINER
A user study to thoroughly study the system’s performance
37ICSE 2019 – May 31, 2019 – Montréal, QC, Canada
Conclusions
https://github.com/crossminer/FOCUS

More Related Content

Similar to FOCUS: A Recommender System for Mining API Function Calls and Usage Patterns

#SiriusCon 2015: Talk by Christophe Boudjennah "Experimenting the Open Source...
#SiriusCon 2015: Talk by Christophe Boudjennah "Experimenting the Open Source...#SiriusCon 2015: Talk by Christophe Boudjennah "Experimenting the Open Source...
#SiriusCon 2015: Talk by Christophe Boudjennah "Experimenting the Open Source...
Obeo
 
'Applying System Science and System Thinking Techniques to BIM Management'
'Applying System Science and System Thinking Techniques to BIM Management' 'Applying System Science and System Thinking Techniques to BIM Management'
'Applying System Science and System Thinking Techniques to BIM Management'
Alan Martin Redmond, PhD
 
Towards Design-space Exploration of Component Chains in Vehicle Software
Towards Design-space Exploration of Component Chains in Vehicle SoftwareTowards Design-space Exploration of Component Chains in Vehicle Software
Towards Design-space Exploration of Component Chains in Vehicle Software
Alessio Bucaioni
 
RT332: Measuring Progress and Productivity in Model-based Engineering
RT332: Measuring Progress and Productivity in Model-based EngineeringRT332: Measuring Progress and Productivity in Model-based Engineering
RT332: Measuring Progress and Productivity in Model-based Engineering
AVEVA Group plc
 
Conference Identity: persistent identifiers for conferences
Conference Identity: persistent identifiers for conferencesConference Identity: persistent identifiers for conferences
Conference Identity: persistent identifiers for conferences
Aliaksandr Birukou
 
Call for Papers - 4th International Conference on Machine Learning & Applicat...
Call for Papers - 4th International Conference on Machine Learning & Applicat...Call for Papers - 4th International Conference on Machine Learning & Applicat...
Call for Papers - 4th International Conference on Machine Learning & Applicat...
ijistjournal
 
Call For papers - 4th International Conference on Machine Learning & Applicat...
Call For papers - 4th International Conference on Machine Learning & Applicat...Call For papers - 4th International Conference on Machine Learning & Applicat...
Call For papers - 4th International Conference on Machine Learning & Applicat...
IJITCA Journal
 
Call for Papers - 4th International Conference on Machine Learning & Applicat...
Call for Papers - 4th International Conference on Machine Learning & Applicat...Call for Papers - 4th International Conference on Machine Learning & Applicat...
Call for Papers - 4th International Conference on Machine Learning & Applicat...
caijjournal
 
Call for Papers - 4th International Conference on Machine Learning & Applicat...
Call for Papers - 4th International Conference on Machine Learning & Applicat...Call for Papers - 4th International Conference on Machine Learning & Applicat...
Call for Papers - 4th International Conference on Machine Learning & Applicat...
ijistjournal
 
Developing recommendation systems to support open source software developers ...
Developing recommendation systems to support open source software developers ...Developing recommendation systems to support open source software developers ...
Developing recommendation systems to support open source software developers ...
Davide Ruscio
 
Continuous Intelligence: Moving Machine Learning into Production Reliably
Continuous Intelligence: Moving Machine Learning into Production ReliablyContinuous Intelligence: Moving Machine Learning into Production Reliably
Continuous Intelligence: Moving Machine Learning into Production Reliably
Dr. Arif Wider
 
Agile London at Ticketmaster
Agile London at TicketmasterAgile London at Ticketmaster
Agile London at Ticketmaster
Billy Jenkins
 
Performance Measurement and Improvement of Lean Manufacturing Operations: A L...
Performance Measurement and Improvement of Lean Manufacturing Operations: A L...Performance Measurement and Improvement of Lean Manufacturing Operations: A L...
Performance Measurement and Improvement of Lean Manufacturing Operations: A L...
Leandro Silvério
 
A Preliminary Study on Architecting Cyber-Physical Systems
A Preliminary Study on Architecting Cyber-Physical SystemsA Preliminary Study on Architecting Cyber-Physical Systems
A Preliminary Study on Architecting Cyber-Physical Systems
Henry Muccini
 
4th International Conference on Machine Learning & Applications (CMLA 2022)
4th International Conference on Machine Learning & Applications (CMLA 2022)4th International Conference on Machine Learning & Applications (CMLA 2022)
4th International Conference on Machine Learning & Applications (CMLA 2022)
ijait
 
CFP: 4th International Conference on Machine Learning & Applications (CMLA 2022)
CFP: 4th International Conference on Machine Learning & Applications (CMLA 2022)CFP: 4th International Conference on Machine Learning & Applications (CMLA 2022)
CFP: 4th International Conference on Machine Learning & Applications (CMLA 2022)
ijsc
 
4thInternational Conference on Machine Learning & Applications (CMLA 2022)
4thInternational Conference on Machine Learning & Applications (CMLA 2022)4thInternational Conference on Machine Learning & Applications (CMLA 2022)
4thInternational Conference on Machine Learning & Applications (CMLA 2022)
acijjournal
 
Call for Papers - 4th International Conference on Machine Learning & Applicat...
Call for Papers - 4th International Conference on Machine Learning & Applicat...Call for Papers - 4th International Conference on Machine Learning & Applicat...
Call for Papers - 4th International Conference on Machine Learning & Applicat...
ijistjournal
 
Call for Paper - 4th International Conference on Machine Learning & Applicati...
Call for Paper - 4th International Conference on Machine Learning & Applicati...Call for Paper - 4th International Conference on Machine Learning & Applicati...
Call for Paper - 4th International Conference on Machine Learning & Applicati...
mlaij
 
4 th International Conference on Machine Learning & Applications (CMLA 2022)
4 th International Conference on Machine Learning & Applications (CMLA 2022)4 th International Conference on Machine Learning & Applications (CMLA 2022)
4 th International Conference on Machine Learning & Applications (CMLA 2022)
ijscai
 

Similar to FOCUS: A Recommender System for Mining API Function Calls and Usage Patterns (20)

#SiriusCon 2015: Talk by Christophe Boudjennah "Experimenting the Open Source...
#SiriusCon 2015: Talk by Christophe Boudjennah "Experimenting the Open Source...#SiriusCon 2015: Talk by Christophe Boudjennah "Experimenting the Open Source...
#SiriusCon 2015: Talk by Christophe Boudjennah "Experimenting the Open Source...
 
'Applying System Science and System Thinking Techniques to BIM Management'
'Applying System Science and System Thinking Techniques to BIM Management' 'Applying System Science and System Thinking Techniques to BIM Management'
'Applying System Science and System Thinking Techniques to BIM Management'
 
Towards Design-space Exploration of Component Chains in Vehicle Software
Towards Design-space Exploration of Component Chains in Vehicle SoftwareTowards Design-space Exploration of Component Chains in Vehicle Software
Towards Design-space Exploration of Component Chains in Vehicle Software
 
RT332: Measuring Progress and Productivity in Model-based Engineering
RT332: Measuring Progress and Productivity in Model-based EngineeringRT332: Measuring Progress and Productivity in Model-based Engineering
RT332: Measuring Progress and Productivity in Model-based Engineering
 
Conference Identity: persistent identifiers for conferences
Conference Identity: persistent identifiers for conferencesConference Identity: persistent identifiers for conferences
Conference Identity: persistent identifiers for conferences
 
Call for Papers - 4th International Conference on Machine Learning & Applicat...
Call for Papers - 4th International Conference on Machine Learning & Applicat...Call for Papers - 4th International Conference on Machine Learning & Applicat...
Call for Papers - 4th International Conference on Machine Learning & Applicat...
 
Call For papers - 4th International Conference on Machine Learning & Applicat...
Call For papers - 4th International Conference on Machine Learning & Applicat...Call For papers - 4th International Conference on Machine Learning & Applicat...
Call For papers - 4th International Conference on Machine Learning & Applicat...
 
Call for Papers - 4th International Conference on Machine Learning & Applicat...
Call for Papers - 4th International Conference on Machine Learning & Applicat...Call for Papers - 4th International Conference on Machine Learning & Applicat...
Call for Papers - 4th International Conference on Machine Learning & Applicat...
 
Call for Papers - 4th International Conference on Machine Learning & Applicat...
Call for Papers - 4th International Conference on Machine Learning & Applicat...Call for Papers - 4th International Conference on Machine Learning & Applicat...
Call for Papers - 4th International Conference on Machine Learning & Applicat...
 
Developing recommendation systems to support open source software developers ...
Developing recommendation systems to support open source software developers ...Developing recommendation systems to support open source software developers ...
Developing recommendation systems to support open source software developers ...
 
Continuous Intelligence: Moving Machine Learning into Production Reliably
Continuous Intelligence: Moving Machine Learning into Production ReliablyContinuous Intelligence: Moving Machine Learning into Production Reliably
Continuous Intelligence: Moving Machine Learning into Production Reliably
 
Agile London at Ticketmaster
Agile London at TicketmasterAgile London at Ticketmaster
Agile London at Ticketmaster
 
Performance Measurement and Improvement of Lean Manufacturing Operations: A L...
Performance Measurement and Improvement of Lean Manufacturing Operations: A L...Performance Measurement and Improvement of Lean Manufacturing Operations: A L...
Performance Measurement and Improvement of Lean Manufacturing Operations: A L...
 
A Preliminary Study on Architecting Cyber-Physical Systems
A Preliminary Study on Architecting Cyber-Physical SystemsA Preliminary Study on Architecting Cyber-Physical Systems
A Preliminary Study on Architecting Cyber-Physical Systems
 
4th International Conference on Machine Learning & Applications (CMLA 2022)
4th International Conference on Machine Learning & Applications (CMLA 2022)4th International Conference on Machine Learning & Applications (CMLA 2022)
4th International Conference on Machine Learning & Applications (CMLA 2022)
 
CFP: 4th International Conference on Machine Learning & Applications (CMLA 2022)
CFP: 4th International Conference on Machine Learning & Applications (CMLA 2022)CFP: 4th International Conference on Machine Learning & Applications (CMLA 2022)
CFP: 4th International Conference on Machine Learning & Applications (CMLA 2022)
 
4thInternational Conference on Machine Learning & Applications (CMLA 2022)
4thInternational Conference on Machine Learning & Applications (CMLA 2022)4thInternational Conference on Machine Learning & Applications (CMLA 2022)
4thInternational Conference on Machine Learning & Applications (CMLA 2022)
 
Call for Papers - 4th International Conference on Machine Learning & Applicat...
Call for Papers - 4th International Conference on Machine Learning & Applicat...Call for Papers - 4th International Conference on Machine Learning & Applicat...
Call for Papers - 4th International Conference on Machine Learning & Applicat...
 
Call for Paper - 4th International Conference on Machine Learning & Applicati...
Call for Paper - 4th International Conference on Machine Learning & Applicati...Call for Paper - 4th International Conference on Machine Learning & Applicati...
Call for Paper - 4th International Conference on Machine Learning & Applicati...
 
4 th International Conference on Machine Learning & Applications (CMLA 2022)
4 th International Conference on Machine Learning & Applications (CMLA 2022)4 th International Conference on Machine Learning & Applications (CMLA 2022)
4 th International Conference on Machine Learning & Applications (CMLA 2022)
 

More from Davide Ruscio

Detecting java software similarities by using different clustering
Detecting java software similarities by using different clusteringDetecting java software similarities by using different clustering
Detecting java software similarities by using different clustering
Davide Ruscio
 
On the way of listening to the crowd for supporting modeling activities
On the way of listening to the crowd for supporting modeling activitiesOn the way of listening to the crowd for supporting modeling activities
On the way of listening to the crowd for supporting modeling activities
Davide Ruscio
 
CrossSim: exploiting mutual relationships to detect similar OSS projects
CrossSim: exploiting mutual relationships to detect similar OSS projectsCrossSim: exploiting mutual relationships to detect similar OSS projects
CrossSim: exploiting mutual relationships to detect similar OSS projects
Davide Ruscio
 
Use of MDE to Analyse Open Source Software
Use of MDE to Analyse Open Source SoftwareUse of MDE to Analyse Open Source Software
Use of MDE to Analyse Open Source Software
Davide Ruscio
 
Consistency Recovery in Interactive Modeling
Consistency Recovery in Interactive ModelingConsistency Recovery in Interactive Modeling
Consistency Recovery in Interactive Modeling
Davide Ruscio
 
Edelta: an approach for defining and applying reusable metamodel refactorings
Edelta: an approach for defining and applying reusable metamodel refactoringsEdelta: an approach for defining and applying reusable metamodel refactorings
Edelta: an approach for defining and applying reusable metamodel refactorings
Davide Ruscio
 
Semantic based model matching with emf compare
Semantic based model matching with emf compareSemantic based model matching with emf compare
Semantic based model matching with emf compare
Davide Ruscio
 
Collaborative model driven software engineering: a Systematic Mapping Study
Collaborative model driven software engineering: a Systematic Mapping StudyCollaborative model driven software engineering: a Systematic Mapping Study
Collaborative model driven software engineering: a Systematic Mapping Study
Davide Ruscio
 
Model repositories: will they become reality?
Model repositories: will they become reality?Model repositories: will they become reality?
Model repositories: will they become reality?
Davide Ruscio
 
Mining Correlations of ATL Transformation and Metamodel Metrics
Mining Correlations of ATL Transformation and Metamodel MetricsMining Correlations of ATL Transformation and Metamodel Metrics
Mining Correlations of ATL Transformation and Metamodel Metrics
Davide Ruscio
 
MDEForge: an extensible Web-based modeling platform
MDEForge: an extensible Web-based modeling platformMDEForge: an extensible Web-based modeling platform
MDEForge: an extensible Web-based modeling platform
Davide Ruscio
 

More from Davide Ruscio (11)

Detecting java software similarities by using different clustering
Detecting java software similarities by using different clusteringDetecting java software similarities by using different clustering
Detecting java software similarities by using different clustering
 
On the way of listening to the crowd for supporting modeling activities
On the way of listening to the crowd for supporting modeling activitiesOn the way of listening to the crowd for supporting modeling activities
On the way of listening to the crowd for supporting modeling activities
 
CrossSim: exploiting mutual relationships to detect similar OSS projects
CrossSim: exploiting mutual relationships to detect similar OSS projectsCrossSim: exploiting mutual relationships to detect similar OSS projects
CrossSim: exploiting mutual relationships to detect similar OSS projects
 
Use of MDE to Analyse Open Source Software
Use of MDE to Analyse Open Source SoftwareUse of MDE to Analyse Open Source Software
Use of MDE to Analyse Open Source Software
 
Consistency Recovery in Interactive Modeling
Consistency Recovery in Interactive ModelingConsistency Recovery in Interactive Modeling
Consistency Recovery in Interactive Modeling
 
Edelta: an approach for defining and applying reusable metamodel refactorings
Edelta: an approach for defining and applying reusable metamodel refactoringsEdelta: an approach for defining and applying reusable metamodel refactorings
Edelta: an approach for defining and applying reusable metamodel refactorings
 
Semantic based model matching with emf compare
Semantic based model matching with emf compareSemantic based model matching with emf compare
Semantic based model matching with emf compare
 
Collaborative model driven software engineering: a Systematic Mapping Study
Collaborative model driven software engineering: a Systematic Mapping StudyCollaborative model driven software engineering: a Systematic Mapping Study
Collaborative model driven software engineering: a Systematic Mapping Study
 
Model repositories: will they become reality?
Model repositories: will they become reality?Model repositories: will they become reality?
Model repositories: will they become reality?
 
Mining Correlations of ATL Transformation and Metamodel Metrics
Mining Correlations of ATL Transformation and Metamodel MetricsMining Correlations of ATL Transformation and Metamodel Metrics
Mining Correlations of ATL Transformation and Metamodel Metrics
 
MDEForge: an extensible Web-based modeling platform
MDEForge: an extensible Web-based modeling platformMDEForge: an extensible Web-based modeling platform
MDEForge: an extensible Web-based modeling platform
 

Recently uploaded

The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
Yara Milbes
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio, Inc.
 
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
OnePlan Solutions
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
Tier1 app
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
Luigi Fugaro
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
dakas1
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
sjcobrien
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Paul Brebner
 
TMU毕业证书精仿办理
TMU毕业证书精仿办理TMU毕业证书精仿办理
TMU毕业证书精仿办理
aeeva
 
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
The Third Creative Media
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdfThe Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
kalichargn70th171
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
Massimo Artizzu
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
Maitrey Patel
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Peter Caitens
 
42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert
vaishalijagtap12
 

Recently uploaded (20)

The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
 
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
 
TMU毕业证书精仿办理
TMU毕业证书精仿办理TMU毕业证书精仿办理
TMU毕业证书精仿办理
 
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdfThe Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
 
42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert
 

FOCUS: A Recommender System for Mining API Function Calls and Usage Patterns

  • 1. http://people.disim.univaq.it/diruscio/ davide.diruscio@univaq.it @ddiruscio FOCUS: A Recommender System for Mining API Function Calls and Usage Patterns Davide Di Ruscio Joint work with Phuong T. Nguyen, Juri Di Rocco, Lina Ochoa, Thomas Degueule, Massimiliano Di Penta
  • 2. 2ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Context Related activities • Searching for candidate components • Evaluating a set of retrieved candidate components to find the most suitable one • Understanding how to use the selected components • Monitoring the selected components Development of new software systems by reusing existing open source components www.crossminer.org @crossminer eclipse.org/scava
  • 3. 3ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Mining and Knowledge Extraction Tools Source code Q&A systems Bug Reports API Documentation Tutorials Configuration Management Systems Advanced IDEs CROSSMINER: high-level view Bringing to the domain of software development the notion of recommendation systems that are typically used for popular e-commerce systems to present users with interesting items previously unknown to them
  • 4. 4ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Kinds of recommendation Depending on the set of selected third-party libraries, the system is able to recommend additional libraries that should be included in the project being developed Given a selected library, the system is able to suggest alternative ones that share some similarities with the selected one Depending on the set of selected libraries, the system shows API documentation and Q&A posts that can help developers to understand how to use the selected libraries During the development, developers get recommendations about API function calls and usage patterns that might be used …
  • 5. 5ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Problem “Which API methods should this piece of client code invoke, considering that it has already invoked these other API methods?”
  • 6. 6ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Explanatory example: method under development
  • 7. 7ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Explanatory example: method declaration Method declaration (MD) Method invocations (MI)
  • 8. 8ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Explanatory example: complete method declaration
  • 9. 9ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Explanatory example: quested recommendations
  • 10. 10ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Explanatory example: quested recommendations List of API function calls: • get, equal, where, select, ...
  • 11. 11ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Explanatory example: quested recommendations Usage patterns: • Snippets of code containing the recommended function calls
  • 12. 12ICSE 2019 – May 31, 2019 – Montréal, QC, Canada FOCUS It recommends API FunctiOn Calls and USage patterns It works on the basis of a context-aware collaborative-filtering system
  • 13. 13ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Recommend products to customers with similar preference Image source: https://towardsdatascience.com/various-implementations-of-collaborative-filtering-100385c6dfe0 Collaborative-Filtering Technique
  • 14. 14ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Collaborative-Filtering Technique University of L'Aquila 14 R1 R2 R3 c1 5 5 2 c2 3 3 4 c3 5 5 ? Internal Meeting, 31 October 2017 User-item matrix: Ratings given to Pizza restaurants by customers
  • 15. 15ICSE 2019 – May 31, 2019 – Montréal, QC, CanadaUniversity of L'Aquila CROSSMINER Toulouse Meeting, 10-12 June 2018 15 Context-aware recommendation
  • 16. 16ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Context-aware recommendation University of L'Aquila CROSSMINER Toulouse Meeting, 10-12 June 2018 16 Examples of context: day of the week, hour of the day, weather conditions, …
  • 17. 17ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Context-aware recommendation University of L'Aquila CROSSMINER Toulouse Meeting, 10-12 June 2018 17 Predict the inclusion of additional invocations
  • 18. 18ICSE 2019 – May 31, 2019 – Montréal, QC, Canada FOCUS architecture
  • 19. 19ICSE 2019 – May 31, 2019 – Montréal, QC, Canada FOCUS architecture
  • 20. 20ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Code Parser The available OSS repositories are mined to extract for each project: - Method declarations - Method invocations - Field accesses - Interface implementations - Class extensions - … Rascal Metaprogramming Language https://www.rascal-mpl.org/
  • 21. 21ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Code Parser The available OSS repositories are mined to extract for each project: - Method declarations - Method invocations - Field accesses - Interface implementations - Class extensions - … Rascal Metaprogramming Language https://www.rascal-mpl.org/
  • 22. 22ICSE 2019 – May 31, 2019 – Montréal, QC, Canada FOCUS architecture
  • 23. 23ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Data encoder Extracted method declarations and invocations of each project are represented in a corresponding rating matrix
  • 24. 24ICSE 2019 – May 31, 2019 – Montréal, QC, CanadaUniversity of L'Aquila CROSSMINER Toulouse Meeting, 10-12 June 2018 24 Representation of Projects-MDs-MIs 3D user-item-context ratings matrix Mappings: – contexts ←→ projects – users ←→ declarations – items ←→ invocations
  • 25. 25ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Similarity calculator Given an active declaration in an active project, we find the subset of: - the most similar projects - and then the most similar declarations in that similar projects
  • 26. 26ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Similarity calculator: Projects and method declarations Graph-based representation of projects and invocations The similarity of two projects p and q is calculated by considering their feature vectors (TF-IDF) The similarities among methods declarations are calculated using the Jaccard similarity index
  • 27. 27ICSE 2019 – May 31, 2019 – Montréal, QC, Canada FOCUS architecture
  • 28. 28ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Recommendation engine: API function calls Generation of a ranked list of API function calls • Additional invocations for the active declaration are predicted by computing the missing ratings • Ranked list of invocations with scores in descending order
  • 29. 29ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Recommendation engine: API usage patterns From the ranked list, top-N method invocations are used as query to search for relevant declarations Source code snippets containing the identified relevant declarations are retrieved from the available source code base
  • 30. 30ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Evaluation Assessing FOCUS capability to recommend API function calls – Accuracy (precision and recall) – Success rate – Time performance Comparing FOCUS with a state-of-the-art tool (PAM*) Two dataset sources: – More than 600 GitHub projects retrieved from Software Heritage – A set of 3,600 jars retrieved from Maven Central * Jaroslav Fowkes, Charles Sutton. Parameter-free probabilistic API mining across GitHub, Proceedings of the 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering (FSE 2016 )
  • 31. 31ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Evaluation process Source Code metadata
  • 32. 32ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Evaluation process: testing project Total number of declarations Declarations that are kept (the rest are discarded) Total number of invocations in a given declaration Invocations that are used as query
  • 33. 33ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Evaluation process: testing project Only the first invocation is provided as a query, and the rest is used as ground-truth data Four invocations are provided as a query, and the rest is used as ground-truth data The first half of the declarations is used as testing data and the second half is removed C1.1 C1.2 The last method declaration is selected as testing and all the remaining declarations are used as training data C2.1 C2.2 Four different configurations
  • 34. 34ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Evaluation key points The performance of FOCUS relies on the availability of background data – the system works effectively given that more OSS projects are available for recommendation Accuracy improves substantially when the query contains more invocations Precision and recall for C1.1 and C1.2 on SH dataset Precision and recall for C1.1 and C1.2 on MV dataset
  • 35. 35ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Evaluation key points A dataset consisting of only 200 projects has been considered Leave-one-out cross-validation has been performed to exploit as much as possible the projects available as background data, given a testing project PAM requires 9 seconds to provide each recommendation while FOCUS just needs 0.095 seconds
  • 36. 36ICSE 2019 – May 31, 2019 – Montréal, QC, Canada What’s next Embedding FOCUS directly into the Eclipse IDE – Under development in CROSSMINER A user study to thoroughly study the system’s performance
  • 37. 37ICSE 2019 – May 31, 2019 – Montréal, QC, Canada Conclusions https://github.com/crossminer/FOCUS