SlideShare una empresa de Scribd logo
1 de 20
Descargar para leer sin conexión
Spotting automatically
cross-language relations

Federico Tomassetti (me)

Giuseppe Rizzo

Marco Torchiano
data.sql
CREATE TABLE Persons (
ID int,
FirstName varchar(255),
LastName varchar(255),
City varchar(255)
);

Person.java
String query = "select ID, FirstName, LastName, "
+ "City " + "from " + dbName
+ ".Persons";
try { ...
while (rs.next()) {
int id = rs.getInt("ID");
String firstName = rs.getString("FirstName");
String lastName = rs.getString("LastName");
String city= rs.getString("City");
} } catch (SQLException e ) {
......
}
data.sql
CREATE TABLE Persons (
ID int,
FirstName varchar(255),
LastName varchar(255),
City varchar(255)
);

Person.java
String query = "select ID, FirstName, LastName, "
+ "City " + "from " + dbName
+ ".Persons";
try { ...
while (rs.next()) {
int id = rs.getInt("ID");
String firstName = rs.getString("FirstName");
String lastName = rs.getString("LastName");
String city= rs.getString("City");
} } catch (SQLException e ) {

(Hopefully it does not happen)
}
…the complexive system, works, sometimes
If we would automatically identify
cross-language relations we could:
• Recognize them
So I am aware that this ID is
related to something else
• Support refactoring
• Validate them
• Navigate them
If we would automatically identify
cross-language relations we could:
• Recognize them
• Support refactoring
If I change one, the others are
updated
• Validate them
• Navigate them
If we would automatically identify
cross-language relations we could:
• Recognize them
• Support refactoring
• Validate them
See broken relations as errors

• Navigate them
If we would automatically identify
cross-language relations we could:
• Recognize them
• Support refactoring
• Validate them
• Navigate them
Click to see the other side of
the relation
CodeModels
ASTs
Embedded AST (prendo immagine da paper)
index.html
<ul id="types">
<li ng-repeat="t in types" ng-class="{'selected': t.id == type}">
<a ng-href="#/{{t.id}}">{{t.title}}</a>
</li>
</ul>

<div ng-repeat="puzzle in puzzles">
<h2>{{puzzle.title}}</h2>
…
</div>
app.js
var types = [
{ id: 'sliding-puzzle', title: 'Sliding puzzle' },
{ id: 'word-search-puzzle', title: 'Word search puzzle' }
];
app.controller('slidingAdvancedCtrl', function($scope) {
$scope.puzzles = [
{ src: './img/misko.jpg', title: 'Miško Hevery', rows: 4, cols: 4 },
{ src: './img/igor.jpg', title: 'Igor Minár', rows: 3, cols: 3 },
{ src: './img/vojta.jpg', title: 'Vojta Jína', rows: 4, cols: 3 }
];
});
index.html
<ul id="types">
<li ng-repeat="t in types" ng-class="{'selected': t.id == type}">
<a ng-href="#/{{t.id}}">{{t.title}}</a>
</li>
</ul>

<div ng-repeat="puzzle in puzzles">
<h2>{{puzzle.title}}</h2>
…
</div>
app.js
var types = [
{ id: 'sliding-puzzle', title: 'Sliding puzzle' },
{ id: 'word-search-puzzle', title: 'Word search puzzle' }
];
app.controller('slidingAdvancedCtrl', function($scope) {
$scope.puzzles = [
{ src: './img/misko.jpg', title: 'Miško Hevery', rows: 4, cols: 4 },
{ src: './img/igor.jpg', title: 'Igor Minár', rows: 3, cols: 3 },
{ src: './img/vojta.jpg', title: 'Vojta Jína', rows: 4, cols: 3 }
];
});
Context of a node:
all the descendants
+
the siblings and their descendants
Context of a node:
all the descendants
+
the siblings and their descendants
How to compare contexts:
1) Take all the values in the context (IDs, strings,
numbers)
+
2) Employ different metrics
Some metrics we use:
• Number of shared values
• Min and max number of different values
• Tversky Index

𝑇𝑉 𝑋, 𝑌 =

|𝑋∩𝑌|
|𝑋∩𝑌|+𝛼|𝑋−𝑌|+𝛽|𝑌−𝑋|

• Jaro, Jaccard, tf-idf and others
How to combine those metrics:
Random Tree tells us
We built a golden set of 1200 candidate relations
(around 140 real relations, the other just same ID)
We train it with golden set
Random Tree find out the best way to combine those
metrics to decide if a pair is related or not

Output of Random Tree

Rule to understand if two nodes with same ID are
connected
How to evaluate it?
10-fold cross valiationn
What we have
• A tool that spot automatically cross-language relations
with a precision and recall > 90% (on a first in-house
dataset)

What now?
• We want to build a larger golden set
• We want to integrate support in editors

Code available at:
https://github.com/orgs/CrossLanguageProject
Spotting Automatically
Cross-Language Relations
Federico Tomassetti, Giuseppe Rizzo, Marco Torchiano
CSMR 2014, Antwerpen, Belgium
Preprint at:
http://www.di.unito.it/~rizzo/publications/Tomassetti_Rizzo-CSMRWCRE2014.pdf

www.slideshare.net/FTomassetti

Code available at:
https://github.com/orgs/CrossLanguageProject

Más contenido relacionado

La actualidad más candente

Desarrollando aplicaciones web en minutos
Desarrollando aplicaciones web en minutosDesarrollando aplicaciones web en minutos
Desarrollando aplicaciones web en minutos
Edgar Suarez
 
Oh, you’re the NY times guy
Oh, you’re the NY times guyOh, you’re the NY times guy
Oh, you’re the NY times guy
David Hayes
 
MongoDBで作るソーシャルデータ新解析基盤
MongoDBで作るソーシャルデータ新解析基盤MongoDBで作るソーシャルデータ新解析基盤
MongoDBで作るソーシャルデータ新解析基盤
Takahiro Inoue
 
MongoDB全機能解説2
MongoDB全機能解説2MongoDB全機能解説2
MongoDB全機能解説2
Takahiro Inoue
 
Ruby Language - A quick tour
Ruby Language - A quick tourRuby Language - A quick tour
Ruby Language - A quick tour
aztack
 
NoSQL を Ruby で実践するための n 個の方法
NoSQL を Ruby で実践するための n 個の方法NoSQL を Ruby で実践するための n 個の方法
NoSQL を Ruby で実践するための n 個の方法
Tomohiro Nishimura
 

La actualidad más candente (20)

PHP object calisthenics
PHP object calisthenicsPHP object calisthenics
PHP object calisthenics
 
HTML5 and CSS3 Refresher
HTML5 and CSS3 RefresherHTML5 and CSS3 Refresher
HTML5 and CSS3 Refresher
 
Desarrollando aplicaciones web en minutos
Desarrollando aplicaciones web en minutosDesarrollando aplicaciones web en minutos
Desarrollando aplicaciones web en minutos
 
Taking Perl to Eleven with Higher-Order Functions
Taking Perl to Eleven with Higher-Order FunctionsTaking Perl to Eleven with Higher-Order Functions
Taking Perl to Eleven with Higher-Order Functions
 
Learning jQuery in 30 minutes
Learning jQuery in 30 minutesLearning jQuery in 30 minutes
Learning jQuery in 30 minutes
 
Node.js - Demnächst auf einem Server in Ihrer Nähe
Node.js - Demnächst auf einem Server in Ihrer NäheNode.js - Demnächst auf einem Server in Ihrer Nähe
Node.js - Demnächst auf einem Server in Ihrer Nähe
 
Scala bad practices, scala.io 2019
Scala bad practices, scala.io 2019Scala bad practices, scala.io 2019
Scala bad practices, scala.io 2019
 
Oh, you’re the NY times guy
Oh, you’re the NY times guyOh, you’re the NY times guy
Oh, you’re the NY times guy
 
jQuery introduction
jQuery introductionjQuery introduction
jQuery introduction
 
Datamapper @ Railsconf2010
Datamapper @ Railsconf2010Datamapper @ Railsconf2010
Datamapper @ Railsconf2010
 
MongoDBで作るソーシャルデータ新解析基盤
MongoDBで作るソーシャルデータ新解析基盤MongoDBで作るソーシャルデータ新解析基盤
MongoDBで作るソーシャルデータ新解析基盤
 
MongoDB全機能解説2
MongoDB全機能解説2MongoDB全機能解説2
MongoDB全機能解説2
 
AST + Better Reflection (PHP Benelux 2016 Unconference)
AST + Better Reflection (PHP Benelux 2016 Unconference)AST + Better Reflection (PHP Benelux 2016 Unconference)
AST + Better Reflection (PHP Benelux 2016 Unconference)
 
Play, Slick, play2-authの間で討死
Play, Slick, play2-authの間で討死Play, Slick, play2-authの間で討死
Play, Slick, play2-authの間で討死
 
SQLAlchemy Seminar
SQLAlchemy SeminarSQLAlchemy Seminar
SQLAlchemy Seminar
 
Nestoria new design
Nestoria new designNestoria new design
Nestoria new design
 
画像Hacks
画像Hacks画像Hacks
画像Hacks
 
Dollar symbol
Dollar symbolDollar symbol
Dollar symbol
 
Ruby Language - A quick tour
Ruby Language - A quick tourRuby Language - A quick tour
Ruby Language - A quick tour
 
NoSQL を Ruby で実践するための n 個の方法
NoSQL を Ruby で実践するための n 個の方法NoSQL を Ruby で実践するための n 個の方法
NoSQL を Ruby で実践するための n 個の方法
 

Destacado

百萬部落客贊助計畫
百萬部落客贊助計畫百萬部落客贊助計畫
百萬部落客贊助計畫
Vista Cheng
 
HR (human resources)
HR (human resources)HR (human resources)
HR (human resources)
yjy0208
 
프레젠테이션1 1
프레젠테이션1 1프레젠테이션1 1
프레젠테이션1 1
Minji KIm
 
Abyne Words Game Design Postmortem
Abyne Words Game Design PostmortemAbyne Words Game Design Postmortem
Abyne Words Game Design Postmortem
Suyeong Park
 

Destacado (13)

百萬部落客贊助計畫
百萬部落客贊助計畫百萬部落客贊助計畫
百萬部落客贊助計畫
 
HR (human resources)
HR (human resources)HR (human resources)
HR (human resources)
 
Magic the gathering
Magic the gatheringMagic the gathering
Magic the gathering
 
En# HowLong
En# HowLongEn# HowLong
En# HowLong
 
Wordswordswords
WordswordswordsWordswordswords
Wordswordswords
 
Wordle
WordleWordle
Wordle
 
5 areas of focus to survive in a digital world
5 areas of focus to survive in a digital world5 areas of focus to survive in a digital world
5 areas of focus to survive in a digital world
 
프레젠테이션1 1
프레젠테이션1 1프레젠테이션1 1
프레젠테이션1 1
 
Abyne Words Game Design Postmortem
Abyne Words Game Design PostmortemAbyne Words Game Design Postmortem
Abyne Words Game Design Postmortem
 
Employer Branding_EACD_Jose Bancaleiro
Employer Branding_EACD_Jose BancaleiroEmployer Branding_EACD_Jose Bancaleiro
Employer Branding_EACD_Jose Bancaleiro
 
METRIC - 린 분석의 데이터 사용법
METRIC - 린 분석의 데이터 사용법METRIC - 린 분석의 데이터 사용법
METRIC - 린 분석의 데이터 사용법
 
Magic of Context - Korean
Magic of Context - KoreanMagic of Context - Korean
Magic of Context - Korean
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 20173 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017
 

Similar a Automatically Spotting Cross-language Relations

Scala presentation by Aleksandar Prokopec
Scala presentation by Aleksandar ProkopecScala presentation by Aleksandar Prokopec
Scala presentation by Aleksandar Prokopec
Loïc Descotte
 
Functional programming using underscorejs
Functional programming using underscorejsFunctional programming using underscorejs
Functional programming using underscorejs
偉格 高
 

Similar a Automatically Spotting Cross-language Relations (20)

Elm: give it a try
Elm: give it a tryElm: give it a try
Elm: give it a try
 
360|iDev
360|iDev360|iDev
360|iDev
 
Beyond Breakpoints: Advanced Debugging with XCode
Beyond Breakpoints: Advanced Debugging with XCodeBeyond Breakpoints: Advanced Debugging with XCode
Beyond Breakpoints: Advanced Debugging with XCode
 
TDC 2014 - JavaScript de qualidade: hoje, amanhã e sempre!
TDC 2014 - JavaScript de qualidade: hoje, amanhã e sempre!TDC 2014 - JavaScript de qualidade: hoje, amanhã e sempre!
TDC 2014 - JavaScript de qualidade: hoje, amanhã e sempre!
 
Drupal Mobile
Drupal MobileDrupal Mobile
Drupal Mobile
 
DataMapper @ RubyEnRails2009
DataMapper @ RubyEnRails2009DataMapper @ RubyEnRails2009
DataMapper @ RubyEnRails2009
 
ScalikeJDBC Tutorial for Beginners
ScalikeJDBC Tutorial for BeginnersScalikeJDBC Tutorial for Beginners
ScalikeJDBC Tutorial for Beginners
 
Scala taxonomy
Scala taxonomyScala taxonomy
Scala taxonomy
 
Persisting Data on SQLite using Room
Persisting Data on SQLite using RoomPersisting Data on SQLite using Room
Persisting Data on SQLite using Room
 
More expressive types for spark with frameless
More expressive types for spark with framelessMore expressive types for spark with frameless
More expressive types for spark with frameless
 
WOTC_Import
WOTC_ImportWOTC_Import
WOTC_Import
 
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
 
What's New In C# 7
What's New In C# 7What's New In C# 7
What's New In C# 7
 
Scala presentation by Aleksandar Prokopec
Scala presentation by Aleksandar ProkopecScala presentation by Aleksandar Prokopec
Scala presentation by Aleksandar Prokopec
 
Http4s, Doobie and Circe: The Functional Web Stack
Http4s, Doobie and Circe: The Functional Web StackHttp4s, Doobie and Circe: The Functional Web Stack
Http4s, Doobie and Circe: The Functional Web Stack
 
여자개발자모임터 6주년 개발 세미나 - Scala Language
여자개발자모임터 6주년 개발 세미나 - Scala Language여자개발자모임터 6주년 개발 세미나 - Scala Language
여자개발자모임터 6주년 개발 세미나 - Scala Language
 
mobl
moblmobl
mobl
 
Functional programming using underscorejs
Functional programming using underscorejsFunctional programming using underscorejs
Functional programming using underscorejs
 
Open Source Search: An Analysis
Open Source Search: An AnalysisOpen Source Search: An Analysis
Open Source Search: An Analysis
 
jQuery Datatables With MongDb
jQuery Datatables With MongDbjQuery Datatables With MongDb
jQuery Datatables With MongDb
 

Más de Federico Tomassetti

Maturity of Software Modelling and Model Driven Engineering: a Survey in the ...
Maturity of Software Modelling and Model Driven Engineering: a Survey in the ...Maturity of Software Modelling and Model Driven Engineering: a Survey in the ...
Maturity of Software Modelling and Model Driven Engineering: a Survey in the ...
Federico Tomassetti
 
Eclipse Florence Day: Modeling in the Italian Industry
Eclipse Florence Day: Modeling in the Italian IndustryEclipse Florence Day: Modeling in the Italian Industry
Eclipse Florence Day: Modeling in the Italian Industry
Federico Tomassetti
 
Estendere Java con il Meta Programming System di JetBrains
Estendere Java con il Meta Programming System di JetBrains Estendere Java con il Meta Programming System di JetBrains
Estendere Java con il Meta Programming System di JetBrains
Federico Tomassetti
 
Xtext Un Framework Per La Creazione Di Dsl
Xtext   Un Framework Per La Creazione Di DslXtext   Un Framework Per La Creazione Di Dsl
Xtext Un Framework Per La Creazione Di Dsl
Federico Tomassetti
 

Más de Federico Tomassetti (12)

Jariko - A JVM interpreter for RPG written in kotlin
Jariko - A JVM interpreter for RPG written in kotlinJariko - A JVM interpreter for RPG written in kotlin
Jariko - A JVM interpreter for RPG written in kotlin
 
JavaParser - A tool to generate, analyze and refactor Java code
JavaParser - A tool to generate, analyze and refactor Java codeJavaParser - A tool to generate, analyze and refactor Java code
JavaParser - A tool to generate, analyze and refactor Java code
 
How do you create a programming language for the JVM?
How do you create a programming language for the JVM?How do you create a programming language for the JVM?
How do you create a programming language for the JVM?
 
Building languages with Kotlin
Building languages with KotlinBuilding languages with Kotlin
Building languages with Kotlin
 
Building languages with Kotlin
Building languages with KotlinBuilding languages with Kotlin
Building languages with Kotlin
 
Lifting variability from C to mbeddr-C
Lifting variability from C to mbeddr-CLifting variability from C to mbeddr-C
Lifting variability from C to mbeddr-C
 
Maturity of Software Modelling and Model Driven Engineering: a Survey in the ...
Maturity of Software Modelling and Model Driven Engineering: a Survey in the ...Maturity of Software Modelling and Model Driven Engineering: a Survey in the ...
Maturity of Software Modelling and Model Driven Engineering: a Survey in the ...
 
Eclipse Florence Day: Modeling in the Italian Industry
Eclipse Florence Day: Modeling in the Italian IndustryEclipse Florence Day: Modeling in the Italian Industry
Eclipse Florence Day: Modeling in the Italian Industry
 
Estendere Java con il Meta Programming System di JetBrains
Estendere Java con il Meta Programming System di JetBrains Estendere Java con il Meta Programming System di JetBrains
Estendere Java con il Meta Programming System di JetBrains
 
What is Federico doing?
What is Federico doing?What is Federico doing?
What is Federico doing?
 
Xtext Un Framework Per La Creazione Di Dsl
Xtext   Un Framework Per La Creazione Di DslXtext   Un Framework Per La Creazione Di Dsl
Xtext Un Framework Per La Creazione Di Dsl
 
Model Driven Web Development Solutions
Model Driven Web Development SolutionsModel Driven Web Development Solutions
Model Driven Web Development Solutions
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

Automatically Spotting Cross-language Relations

  • 1. Spotting automatically cross-language relations Federico Tomassetti (me) Giuseppe Rizzo Marco Torchiano
  • 2. data.sql CREATE TABLE Persons ( ID int, FirstName varchar(255), LastName varchar(255), City varchar(255) ); Person.java String query = "select ID, FirstName, LastName, " + "City " + "from " + dbName + ".Persons"; try { ... while (rs.next()) { int id = rs.getInt("ID"); String firstName = rs.getString("FirstName"); String lastName = rs.getString("LastName"); String city= rs.getString("City"); } } catch (SQLException e ) { ...... }
  • 3. data.sql CREATE TABLE Persons ( ID int, FirstName varchar(255), LastName varchar(255), City varchar(255) ); Person.java String query = "select ID, FirstName, LastName, " + "City " + "from " + dbName + ".Persons"; try { ... while (rs.next()) { int id = rs.getInt("ID"); String firstName = rs.getString("FirstName"); String lastName = rs.getString("LastName"); String city= rs.getString("City"); } } catch (SQLException e ) { (Hopefully it does not happen) }
  • 4. …the complexive system, works, sometimes
  • 5. If we would automatically identify cross-language relations we could: • Recognize them So I am aware that this ID is related to something else • Support refactoring • Validate them • Navigate them
  • 6. If we would automatically identify cross-language relations we could: • Recognize them • Support refactoring If I change one, the others are updated • Validate them • Navigate them
  • 7. If we would automatically identify cross-language relations we could: • Recognize them • Support refactoring • Validate them See broken relations as errors • Navigate them
  • 8. If we would automatically identify cross-language relations we could: • Recognize them • Support refactoring • Validate them • Navigate them Click to see the other side of the relation
  • 9.
  • 11. Embedded AST (prendo immagine da paper)
  • 12. index.html <ul id="types"> <li ng-repeat="t in types" ng-class="{'selected': t.id == type}"> <a ng-href="#/{{t.id}}">{{t.title}}</a> </li> </ul> <div ng-repeat="puzzle in puzzles"> <h2>{{puzzle.title}}</h2> … </div> app.js var types = [ { id: 'sliding-puzzle', title: 'Sliding puzzle' }, { id: 'word-search-puzzle', title: 'Word search puzzle' } ]; app.controller('slidingAdvancedCtrl', function($scope) { $scope.puzzles = [ { src: './img/misko.jpg', title: 'Miško Hevery', rows: 4, cols: 4 }, { src: './img/igor.jpg', title: 'Igor Minár', rows: 3, cols: 3 }, { src: './img/vojta.jpg', title: 'Vojta Jína', rows: 4, cols: 3 } ]; });
  • 13. index.html <ul id="types"> <li ng-repeat="t in types" ng-class="{'selected': t.id == type}"> <a ng-href="#/{{t.id}}">{{t.title}}</a> </li> </ul> <div ng-repeat="puzzle in puzzles"> <h2>{{puzzle.title}}</h2> … </div> app.js var types = [ { id: 'sliding-puzzle', title: 'Sliding puzzle' }, { id: 'word-search-puzzle', title: 'Word search puzzle' } ]; app.controller('slidingAdvancedCtrl', function($scope) { $scope.puzzles = [ { src: './img/misko.jpg', title: 'Miško Hevery', rows: 4, cols: 4 }, { src: './img/igor.jpg', title: 'Igor Minár', rows: 3, cols: 3 }, { src: './img/vojta.jpg', title: 'Vojta Jína', rows: 4, cols: 3 } ]; });
  • 14. Context of a node: all the descendants + the siblings and their descendants
  • 15. Context of a node: all the descendants + the siblings and their descendants
  • 16. How to compare contexts: 1) Take all the values in the context (IDs, strings, numbers) + 2) Employ different metrics Some metrics we use: • Number of shared values • Min and max number of different values • Tversky Index 𝑇𝑉 𝑋, 𝑌 = |𝑋∩𝑌| |𝑋∩𝑌|+𝛼|𝑋−𝑌|+𝛽|𝑌−𝑋| • Jaro, Jaccard, tf-idf and others
  • 17. How to combine those metrics: Random Tree tells us We built a golden set of 1200 candidate relations (around 140 real relations, the other just same ID) We train it with golden set Random Tree find out the best way to combine those metrics to decide if a pair is related or not Output of Random Tree Rule to understand if two nodes with same ID are connected
  • 18. How to evaluate it? 10-fold cross valiationn
  • 19. What we have • A tool that spot automatically cross-language relations with a precision and recall > 90% (on a first in-house dataset) What now? • We want to build a larger golden set • We want to integrate support in editors Code available at: https://github.com/orgs/CrossLanguageProject
  • 20. Spotting Automatically Cross-Language Relations Federico Tomassetti, Giuseppe Rizzo, Marco Torchiano CSMR 2014, Antwerpen, Belgium Preprint at: http://www.di.unito.it/~rizzo/publications/Tomassetti_Rizzo-CSMRWCRE2014.pdf www.slideshare.net/FTomassetti Code available at: https://github.com/orgs/CrossLanguageProject