SlideShare ist ein Scribd-Unternehmen logo
1 von 28
Downloaden Sie, um offline zu lesen
Local Search-based
Pattern Matching Features in
EMF-IncQuery
2015. 07. 22. 1Local search-based pattern matching features in EMF-IncQuery
Márton Búr, Zoltán Ujhelyi, Ákos Horváth, Dániel Varró
Presenter: Ábel Hegedüs
IncQuery Labs Ltd.
Budapest University of Technology and Economics
Anti-pattern Detection in Java Programs
2015. 07. 22. 2Local search-based pattern matching features in EMF-IncQuery
public class StringLiteralCompareTest {
public StringLiteralCompareTest srcVar;
@Override
public boolean equals(Object other) {
return super.equals(other);
}
public void test() {
srcVar.equals("source");
}
}
Anti-pattern Detection in Java Programs
2015. 07. 22. 3Local search-based pattern matching features in EMF-IncQuery
public class StringLiteralCompareTest {
public StringLiteralCompareTest srcVar;
@Override
public boolean equals(Object other) {
return super.equals(other);
}
public void test() {
srcVar.equals("source");
}
}
EMF metamodel of Java programs (part)
Anti-pattern Detection in Java Programs
2015. 07. 22. 4Local search-based pattern matching features in EMF-IncQuery
public class StringLiteralCompareTest {
public StringLiteralCompareTest srcVar;
@Override
public boolean equals(Object other) {
return super.equals(other);
}
public void test() {
srcVar.equals("source");
}
}
Instance model in EMF editor
Anti-pattern Detection in Java Programs
2015. 07. 22. 5Local search-based pattern matching features in EMF-IncQuery
public class StringLiteralCompareTest {
public StringLiteralCompareTest srcVar;
@Override
public boolean equals(Object other) {
return super.equals(other);
}
public void test() {
srcVar.equals("source");
}
}
String Literal as Compare Parameter
(anti-pattern as graph pattern)
inv: MethodInvocation
name = “equals”
m: NormalMethod
arg: StringLiteral
op: Literal
invokes operand
argument
check count
matches == 1
: Expression
Pattern Matching Strategies
2015. 07. 22. 6Local search-based pattern matching features in EMF-IncQuery
Local Search
• Executes a search plan
• Lower memory requirements
• Tools: ATL, GrGen.net, FUJABA, …
Incremental
• Maintains a cache structure
• Efficient recalculation
• Tools: EMF-IncQuery, Drools, ...
Local-search Based Pattern Matching
2015. 07. 22. 7Local search-based pattern matching features in EMF-IncQuery
Find all m that m ∈ NormalMethod
Attribute test: m.name=="equals”
Find inv that inv.invokes → m
Count of inv.argument → arg is 1
Find arg that inv.argument → arg
Instance test: arg is a StringLiteral
Find op that inv.operand → op
NEG: op is not a Literal8
7
6
5
4
3
2
1
Local-search Based Pattern Matching
2015. 07. 22. 8Local search-based pattern matching features in EMF-IncQuery
Normal Method
1
Find all m that m ∈ NormalMethod
Attribute test: m.name=="equals”
Find inv that inv.invokes → m
Count of inv.argument → arg is 1
Find arg that inv.argument → arg
Instance test: arg is a StringLiteral
Find op that inv.operand → op
NEG: op is not a Literal8
7
6
5
4
3
2
1
Local-search Based Pattern Matching
2015. 07. 22. 9Local search-based pattern matching features in EMF-IncQuery
Normal Method
1
2
Find all m that m ∈ NormalMethod
Attribute test: m.name=="equals”
Find inv that inv.invokes → m
Count of inv.argument → arg is 1
Find arg that inv.argument → arg
Instance test: arg is a StringLiteral
Find op that inv.operand → op
NEG: op is not a Literal8
7
6
5
4
3
2
1
name: “equals”
Local-search Based Pattern Matching
2015. 07. 22. 10Local search-based pattern matching features in EMF-IncQuery
Normal Method
Method
Invocation
invokes
1
2
3
Find all m that m ∈ NormalMethod
Attribute test: m.name=="equals”
Find inv that inv.invokes → m
Count of inv.argument → arg is 1
Find arg that inv.argument → arg
Instance test: arg is a StringLiteral
Find op that inv.operand → op
NEG: op is not a Literal8
7
6
5
4
3
2
1
name: “equals”
Local-search Based Pattern Matching
2015. 07. 22. 11Local search-based pattern matching features in EMF-IncQuery
Normal Method
StringLiteral
Method
Invocation
invokes
1
2
3
6
Find all m that m ∈ NormalMethod
Attribute test: m.name=="equals”
Find inv that inv.invokes → m
Count of inv.argument → arg is 1
Find arg that inv.argument → arg
Instance test: arg is a StringLiteral
Find op that inv.operand → op
NEG: op is not a Literal8
7
6
5
4
3
2
1
name: “equals”
Local-search Based Pattern Matching
2015. 07. 22. 12Local search-based pattern matching features in EMF-IncQuery
Normal Method
StringLiteral
Identifier
Method
Invocation
invokes
1
2
3
6
8
Find all m that m ∈ NormalMethod
Attribute test: m.name=="equals”
Find inv that inv.invokes → m
Count of inv.argument → arg is 1
Find arg that inv.argument → arg
Instance test: arg is a StringLiteral
Find op that inv.operand → op
NEG: op is not a Literal8
7
6
5
4
3
2
1
name: “equals”
EMF-IncQuery
2015. 07. 22. 13Local search-based pattern matching features in EMF-IncQuery
Runtime
Incremental
queries using
Rete backend
Local search
backend
IDE
Language
Code
generator
Development
tools
Query
Explorer
Local Search
Debugger
Local Search Runtime
2015. 07. 22. 14Local search-based pattern matching features in EMF-IncQuery
IncQuery Engine
Model
Graph
patterns
Local Search Runtime
2015. 07. 22. 15Local search-based pattern matching features in EMF-IncQuery
IncQuery Engine
Model
Graph
patterns
• Calculates matches
• Manages model indexes
Local Search Runtime
2015. 07. 22. 16Local search-based pattern matching features in EMF-IncQuery
IncQuery Engine
Model
Rete backend
Graph
patterns
Local Search Runtime
2015. 07. 22. 17Local search-based pattern matching features in EMF-IncQuery
IncQuery Engine
Model
Rete backend
Graph
patterns
Default (incremental)
query executor
Local Search Runtime
2015. 07. 22. 18Local search-based pattern matching features in EMF-IncQuery
IncQuery Engine
Model
Rete backend
Graph
patterns
Pattern matches
Local Search Runtime
2015. 07. 22. 19Local search-based pattern matching features in EMF-IncQuery
IncQuery Engine
Model
Local search backend
Planner
Graph
patterns
Pattern matches
• Initializes search plans
• Reuses pre-populated
model indexes
Local Search Runtime
2015. 07. 22. 20Local search-based pattern matching features in EMF-IncQuery
IncQuery Engine
Model
Local search backend
Planner Matcher
Graph
patterns
Pattern matches
• Executes search plans
• Based on depth-first search
EMF-IncQuery IDE
2015. 07. 22. 21Local search-based pattern matching features in EMF-IncQuery
EMF-IncQuery IDE
2015. 07. 22. 22Local search-based pattern matching features in EMF-IncQuery
Query Editor
Defines graph patterns
Model Editor
EMF-based editor
Query Explorer
Displays query results
Local Search Debugger
2015. 07. 22. 23Local search-based pattern matching features in EMF-IncQuery
Step-by-step execution of search plans
• Visualizes search plans
• Visualizes (partial) query results
Local Search Debugger
2015. 07. 22. 24Local search-based pattern matching features in EMF-IncQuery
Step-by-step execution of search plans
• Visualizes search plans
• Visualizes (partial) query results
Local Search Debugger
• Based on local search
• Visualizes query
structure
• Step-by-step
execution
Query Explorer
• Relies on incremental
query evaluation
• Reacts on model
changes
• Results can be filtered
DEMO
2015. 07. 22. 25Local search-based pattern matching features in EMF-IncQuery
Performance Characteristics – 1.
2015. 07. 22. 26Local search-based pattern matching features in EMF-IncQuery
1
10
100
1000 10000 100000
SEARCHTIME(S)
PROGRAM SIZE (LOC)
LS INC LS (100) INC (100) LS INC LS (100) INC (100)
Incremental approach is beneficial
in case of re-evaluation
Performance Characteristics – 2.
2015. 07. 22. 27Local search-based pattern matching features in EMF-IncQuery
1
10
100
1000
10000
100000
1000 10000 100000 1000000 10000000
MEMORYUSAGE(MB)
PROGRAM SIZE (LOC)
LS INC LS INC
Local search works
uses less memory
Summary
Local search based pattern matcher
• Alternative execution strategy
• Reuses existing infrastructure
Search Plan Debugger
• Step-by-step execution of search plans
• Complements Query Explorer
Future plans
• Enhanced search plan generation
• Hybrid pattern matching
2015. 07. 22. 28Local search-based pattern matching features in EMF-IncQuery

Weitere ähnliche Inhalte

Ähnlich wie Local search-based pattern matching features in EMF-IncQuery

Local search-based pattern matching features in EMF-IncQuery
Local search-based pattern matching features in EMF-IncQueryLocal search-based pattern matching features in EMF-IncQuery
Local search-based pattern matching features in EMF-IncQueryÁkos Horváth
 
Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScriptFu Cheng
 
Testing untestable Code - PFCongres 2010
Testing untestable Code - PFCongres 2010Testing untestable Code - PFCongres 2010
Testing untestable Code - PFCongres 2010Stephan Hochdörfer
 
Api specification based function search engine using natural language query-S...
Api specification based function search engine using natural language query-S...Api specification based function search engine using natural language query-S...
Api specification based function search engine using natural language query-S...Sanif Sanif
 
Nearest neighbour algorithm
Nearest neighbour algorithmNearest neighbour algorithm
Nearest neighbour algorithmAnmitas1
 
Javascript Objects Deep Dive
Javascript Objects Deep DiveJavascript Objects Deep Dive
Javascript Objects Deep DiveManish Jangir
 
Looking for Bugs in MonoDevelop
Looking for Bugs in MonoDevelopLooking for Bugs in MonoDevelop
Looking for Bugs in MonoDevelopPVS-Studio
 
Developer testing 101: Become a Testing Fanatic
Developer testing 101: Become a Testing FanaticDeveloper testing 101: Become a Testing Fanatic
Developer testing 101: Become a Testing FanaticLB Denker
 
Testing untestable code - phpday
Testing untestable code - phpdayTesting untestable code - phpday
Testing untestable code - phpdayStephan Hochdörfer
 
Mutation Testing: Testing your tests
Mutation Testing: Testing your testsMutation Testing: Testing your tests
Mutation Testing: Testing your testsStephen Leigh
 
Learning to rank search results
Learning to rank search resultsLearning to rank search results
Learning to rank search resultsJettro Coenradie
 
JavaScript - Programming Languages course
JavaScript - Programming Languages course JavaScript - Programming Languages course
JavaScript - Programming Languages course yoavrubin
 
ElasticSearch, Elastica, ElasticaBundle
ElasticSearch, Elastica, ElasticaBundleElasticSearch, Elastica, ElasticaBundle
ElasticSearch, Elastica, ElasticaBundleNicolas Badey
 
Behaviour driven infrastructure
Behaviour driven infrastructureBehaviour driven infrastructure
Behaviour driven infrastructureLindsay Holmwood
 
Scaling your Android App With Modularization
Scaling your Android App With ModularizationScaling your Android App With Modularization
Scaling your Android App With ModularizationBen Schwab
 
Beyond design patterns phpnw14
Beyond design patterns   phpnw14Beyond design patterns   phpnw14
Beyond design patterns phpnw14Anthony Ferrara
 

Ähnlich wie Local search-based pattern matching features in EMF-IncQuery (20)

Local search-based pattern matching features in EMF-IncQuery
Local search-based pattern matching features in EMF-IncQueryLocal search-based pattern matching features in EMF-IncQuery
Local search-based pattern matching features in EMF-IncQuery
 
Testing untestable code - DPC10
Testing untestable code - DPC10Testing untestable code - DPC10
Testing untestable code - DPC10
 
Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScript
 
Testing untestable Code - PFCongres 2010
Testing untestable Code - PFCongres 2010Testing untestable Code - PFCongres 2010
Testing untestable Code - PFCongres 2010
 
Api specification based function search engine using natural language query-S...
Api specification based function search engine using natural language query-S...Api specification based function search engine using natural language query-S...
Api specification based function search engine using natural language query-S...
 
Nearest neighbour algorithm
Nearest neighbour algorithmNearest neighbour algorithm
Nearest neighbour algorithm
 
Javascript Objects Deep Dive
Javascript Objects Deep DiveJavascript Objects Deep Dive
Javascript Objects Deep Dive
 
Looking for Bugs in MonoDevelop
Looking for Bugs in MonoDevelopLooking for Bugs in MonoDevelop
Looking for Bugs in MonoDevelop
 
Developer testing 101: Become a Testing Fanatic
Developer testing 101: Become a Testing FanaticDeveloper testing 101: Become a Testing Fanatic
Developer testing 101: Become a Testing Fanatic
 
Testing untestable code - phpday
Testing untestable code - phpdayTesting untestable code - phpday
Testing untestable code - phpday
 
Mutation Testing: Testing your tests
Mutation Testing: Testing your testsMutation Testing: Testing your tests
Mutation Testing: Testing your tests
 
Learning to rank search results
Learning to rank search resultsLearning to rank search results
Learning to rank search results
 
JavaScript - Programming Languages course
JavaScript - Programming Languages course JavaScript - Programming Languages course
JavaScript - Programming Languages course
 
ElasticSearch, Elastica, ElasticaBundle
ElasticSearch, Elastica, ElasticaBundleElasticSearch, Elastica, ElasticaBundle
ElasticSearch, Elastica, ElasticaBundle
 
Js tips & tricks
Js tips & tricksJs tips & tricks
Js tips & tricks
 
Behaviour driven infrastructure
Behaviour driven infrastructureBehaviour driven infrastructure
Behaviour driven infrastructure
 
JavaScript Essentials
JavaScript EssentialsJavaScript Essentials
JavaScript Essentials
 
Scaling your Android App With Modularization
Scaling your Android App With ModularizationScaling your Android App With Modularization
Scaling your Android App With Modularization
 
BigCloneBench
BigCloneBenchBigCloneBench
BigCloneBench
 
Beyond design patterns phpnw14
Beyond design patterns   phpnw14Beyond design patterns   phpnw14
Beyond design patterns phpnw14
 

Kürzlich hochgeladen

Pests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPirithiRaju
 
Chromatin Structure | EUCHROMATIN | HETEROCHROMATIN
Chromatin Structure | EUCHROMATIN | HETEROCHROMATINChromatin Structure | EUCHROMATIN | HETEROCHROMATIN
Chromatin Structure | EUCHROMATIN | HETEROCHROMATINsankalpkumarsahoo174
 
Biopesticide (2).pptx .This slides helps to know the different types of biop...
Biopesticide (2).pptx  .This slides helps to know the different types of biop...Biopesticide (2).pptx  .This slides helps to know the different types of biop...
Biopesticide (2).pptx .This slides helps to know the different types of biop...RohitNehra6
 
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdfPests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdfPirithiRaju
 
Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )aarthirajkumar25
 
Pests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdfPests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdfPirithiRaju
 
Raman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral Analysis
Raman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral AnalysisRaman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral Analysis
Raman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral AnalysisDiwakar Mishra
 
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...ssifa0344
 
Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksSérgio Sacani
 
Presentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptxPresentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptxgindu3009
 
Botany 4th semester series (krishna).pdf
Botany 4th semester series (krishna).pdfBotany 4th semester series (krishna).pdf
Botany 4th semester series (krishna).pdfSumit Kumar yadav
 
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...anilsa9823
 
Forensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdfForensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdfrohankumarsinghrore1
 
Spermiogenesis or Spermateleosis or metamorphosis of spermatid
Spermiogenesis or Spermateleosis or metamorphosis of spermatidSpermiogenesis or Spermateleosis or metamorphosis of spermatid
Spermiogenesis or Spermateleosis or metamorphosis of spermatidSarthak Sekhar Mondal
 
Natural Polymer Based Nanomaterials
Natural Polymer Based NanomaterialsNatural Polymer Based Nanomaterials
Natural Polymer Based NanomaterialsAArockiyaNisha
 
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.Nitya salvi
 
Animal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptxAnimal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptxUmerFayaz5
 
Zoology 4th semester series (krishna).pdf
Zoology 4th semester series (krishna).pdfZoology 4th semester series (krishna).pdf
Zoology 4th semester series (krishna).pdfSumit Kumar yadav
 
DIFFERENCE IN BACK CROSS AND TEST CROSS
DIFFERENCE IN  BACK CROSS AND TEST CROSSDIFFERENCE IN  BACK CROSS AND TEST CROSS
DIFFERENCE IN BACK CROSS AND TEST CROSSLeenakshiTyagi
 

Kürzlich hochgeladen (20)

Pests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdf
 
Chromatin Structure | EUCHROMATIN | HETEROCHROMATIN
Chromatin Structure | EUCHROMATIN | HETEROCHROMATINChromatin Structure | EUCHROMATIN | HETEROCHROMATIN
Chromatin Structure | EUCHROMATIN | HETEROCHROMATIN
 
Biopesticide (2).pptx .This slides helps to know the different types of biop...
Biopesticide (2).pptx  .This slides helps to know the different types of biop...Biopesticide (2).pptx  .This slides helps to know the different types of biop...
Biopesticide (2).pptx .This slides helps to know the different types of biop...
 
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdfPests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
 
Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )
 
Pests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdfPests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdf
 
Raman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral Analysis
Raman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral AnalysisRaman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral Analysis
Raman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral Analysis
 
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...
 
Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disks
 
CELL -Structural and Functional unit of life.pdf
CELL -Structural and Functional unit of life.pdfCELL -Structural and Functional unit of life.pdf
CELL -Structural and Functional unit of life.pdf
 
Presentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptxPresentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptx
 
Botany 4th semester series (krishna).pdf
Botany 4th semester series (krishna).pdfBotany 4th semester series (krishna).pdf
Botany 4th semester series (krishna).pdf
 
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
 
Forensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdfForensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdf
 
Spermiogenesis or Spermateleosis or metamorphosis of spermatid
Spermiogenesis or Spermateleosis or metamorphosis of spermatidSpermiogenesis or Spermateleosis or metamorphosis of spermatid
Spermiogenesis or Spermateleosis or metamorphosis of spermatid
 
Natural Polymer Based Nanomaterials
Natural Polymer Based NanomaterialsNatural Polymer Based Nanomaterials
Natural Polymer Based Nanomaterials
 
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
 
Animal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptxAnimal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptx
 
Zoology 4th semester series (krishna).pdf
Zoology 4th semester series (krishna).pdfZoology 4th semester series (krishna).pdf
Zoology 4th semester series (krishna).pdf
 
DIFFERENCE IN BACK CROSS AND TEST CROSS
DIFFERENCE IN  BACK CROSS AND TEST CROSSDIFFERENCE IN  BACK CROSS AND TEST CROSS
DIFFERENCE IN BACK CROSS AND TEST CROSS
 

Local search-based pattern matching features in EMF-IncQuery

  • 1. Local Search-based Pattern Matching Features in EMF-IncQuery 2015. 07. 22. 1Local search-based pattern matching features in EMF-IncQuery Márton Búr, Zoltán Ujhelyi, Ákos Horváth, Dániel Varró Presenter: Ábel Hegedüs IncQuery Labs Ltd. Budapest University of Technology and Economics
  • 2. Anti-pattern Detection in Java Programs 2015. 07. 22. 2Local search-based pattern matching features in EMF-IncQuery public class StringLiteralCompareTest { public StringLiteralCompareTest srcVar; @Override public boolean equals(Object other) { return super.equals(other); } public void test() { srcVar.equals("source"); } }
  • 3. Anti-pattern Detection in Java Programs 2015. 07. 22. 3Local search-based pattern matching features in EMF-IncQuery public class StringLiteralCompareTest { public StringLiteralCompareTest srcVar; @Override public boolean equals(Object other) { return super.equals(other); } public void test() { srcVar.equals("source"); } } EMF metamodel of Java programs (part)
  • 4. Anti-pattern Detection in Java Programs 2015. 07. 22. 4Local search-based pattern matching features in EMF-IncQuery public class StringLiteralCompareTest { public StringLiteralCompareTest srcVar; @Override public boolean equals(Object other) { return super.equals(other); } public void test() { srcVar.equals("source"); } } Instance model in EMF editor
  • 5. Anti-pattern Detection in Java Programs 2015. 07. 22. 5Local search-based pattern matching features in EMF-IncQuery public class StringLiteralCompareTest { public StringLiteralCompareTest srcVar; @Override public boolean equals(Object other) { return super.equals(other); } public void test() { srcVar.equals("source"); } } String Literal as Compare Parameter (anti-pattern as graph pattern) inv: MethodInvocation name = “equals” m: NormalMethod arg: StringLiteral op: Literal invokes operand argument check count matches == 1 : Expression
  • 6. Pattern Matching Strategies 2015. 07. 22. 6Local search-based pattern matching features in EMF-IncQuery Local Search • Executes a search plan • Lower memory requirements • Tools: ATL, GrGen.net, FUJABA, … Incremental • Maintains a cache structure • Efficient recalculation • Tools: EMF-IncQuery, Drools, ...
  • 7. Local-search Based Pattern Matching 2015. 07. 22. 7Local search-based pattern matching features in EMF-IncQuery Find all m that m ∈ NormalMethod Attribute test: m.name=="equals” Find inv that inv.invokes → m Count of inv.argument → arg is 1 Find arg that inv.argument → arg Instance test: arg is a StringLiteral Find op that inv.operand → op NEG: op is not a Literal8 7 6 5 4 3 2 1
  • 8. Local-search Based Pattern Matching 2015. 07. 22. 8Local search-based pattern matching features in EMF-IncQuery Normal Method 1 Find all m that m ∈ NormalMethod Attribute test: m.name=="equals” Find inv that inv.invokes → m Count of inv.argument → arg is 1 Find arg that inv.argument → arg Instance test: arg is a StringLiteral Find op that inv.operand → op NEG: op is not a Literal8 7 6 5 4 3 2 1
  • 9. Local-search Based Pattern Matching 2015. 07. 22. 9Local search-based pattern matching features in EMF-IncQuery Normal Method 1 2 Find all m that m ∈ NormalMethod Attribute test: m.name=="equals” Find inv that inv.invokes → m Count of inv.argument → arg is 1 Find arg that inv.argument → arg Instance test: arg is a StringLiteral Find op that inv.operand → op NEG: op is not a Literal8 7 6 5 4 3 2 1 name: “equals”
  • 10. Local-search Based Pattern Matching 2015. 07. 22. 10Local search-based pattern matching features in EMF-IncQuery Normal Method Method Invocation invokes 1 2 3 Find all m that m ∈ NormalMethod Attribute test: m.name=="equals” Find inv that inv.invokes → m Count of inv.argument → arg is 1 Find arg that inv.argument → arg Instance test: arg is a StringLiteral Find op that inv.operand → op NEG: op is not a Literal8 7 6 5 4 3 2 1 name: “equals”
  • 11. Local-search Based Pattern Matching 2015. 07. 22. 11Local search-based pattern matching features in EMF-IncQuery Normal Method StringLiteral Method Invocation invokes 1 2 3 6 Find all m that m ∈ NormalMethod Attribute test: m.name=="equals” Find inv that inv.invokes → m Count of inv.argument → arg is 1 Find arg that inv.argument → arg Instance test: arg is a StringLiteral Find op that inv.operand → op NEG: op is not a Literal8 7 6 5 4 3 2 1 name: “equals”
  • 12. Local-search Based Pattern Matching 2015. 07. 22. 12Local search-based pattern matching features in EMF-IncQuery Normal Method StringLiteral Identifier Method Invocation invokes 1 2 3 6 8 Find all m that m ∈ NormalMethod Attribute test: m.name=="equals” Find inv that inv.invokes → m Count of inv.argument → arg is 1 Find arg that inv.argument → arg Instance test: arg is a StringLiteral Find op that inv.operand → op NEG: op is not a Literal8 7 6 5 4 3 2 1 name: “equals”
  • 13. EMF-IncQuery 2015. 07. 22. 13Local search-based pattern matching features in EMF-IncQuery Runtime Incremental queries using Rete backend Local search backend IDE Language Code generator Development tools Query Explorer Local Search Debugger
  • 14. Local Search Runtime 2015. 07. 22. 14Local search-based pattern matching features in EMF-IncQuery IncQuery Engine Model Graph patterns
  • 15. Local Search Runtime 2015. 07. 22. 15Local search-based pattern matching features in EMF-IncQuery IncQuery Engine Model Graph patterns • Calculates matches • Manages model indexes
  • 16. Local Search Runtime 2015. 07. 22. 16Local search-based pattern matching features in EMF-IncQuery IncQuery Engine Model Rete backend Graph patterns
  • 17. Local Search Runtime 2015. 07. 22. 17Local search-based pattern matching features in EMF-IncQuery IncQuery Engine Model Rete backend Graph patterns Default (incremental) query executor
  • 18. Local Search Runtime 2015. 07. 22. 18Local search-based pattern matching features in EMF-IncQuery IncQuery Engine Model Rete backend Graph patterns Pattern matches
  • 19. Local Search Runtime 2015. 07. 22. 19Local search-based pattern matching features in EMF-IncQuery IncQuery Engine Model Local search backend Planner Graph patterns Pattern matches • Initializes search plans • Reuses pre-populated model indexes
  • 20. Local Search Runtime 2015. 07. 22. 20Local search-based pattern matching features in EMF-IncQuery IncQuery Engine Model Local search backend Planner Matcher Graph patterns Pattern matches • Executes search plans • Based on depth-first search
  • 21. EMF-IncQuery IDE 2015. 07. 22. 21Local search-based pattern matching features in EMF-IncQuery
  • 22. EMF-IncQuery IDE 2015. 07. 22. 22Local search-based pattern matching features in EMF-IncQuery Query Editor Defines graph patterns Model Editor EMF-based editor Query Explorer Displays query results
  • 23. Local Search Debugger 2015. 07. 22. 23Local search-based pattern matching features in EMF-IncQuery Step-by-step execution of search plans • Visualizes search plans • Visualizes (partial) query results
  • 24. Local Search Debugger 2015. 07. 22. 24Local search-based pattern matching features in EMF-IncQuery Step-by-step execution of search plans • Visualizes search plans • Visualizes (partial) query results Local Search Debugger • Based on local search • Visualizes query structure • Step-by-step execution Query Explorer • Relies on incremental query evaluation • Reacts on model changes • Results can be filtered
  • 25. DEMO 2015. 07. 22. 25Local search-based pattern matching features in EMF-IncQuery
  • 26. Performance Characteristics – 1. 2015. 07. 22. 26Local search-based pattern matching features in EMF-IncQuery 1 10 100 1000 10000 100000 SEARCHTIME(S) PROGRAM SIZE (LOC) LS INC LS (100) INC (100) LS INC LS (100) INC (100) Incremental approach is beneficial in case of re-evaluation
  • 27. Performance Characteristics – 2. 2015. 07. 22. 27Local search-based pattern matching features in EMF-IncQuery 1 10 100 1000 10000 100000 1000 10000 100000 1000000 10000000 MEMORYUSAGE(MB) PROGRAM SIZE (LOC) LS INC LS INC Local search works uses less memory
  • 28. Summary Local search based pattern matcher • Alternative execution strategy • Reuses existing infrastructure Search Plan Debugger • Step-by-step execution of search plans • Complements Query Explorer Future plans • Enhanced search plan generation • Hybrid pattern matching 2015. 07. 22. 28Local search-based pattern matching features in EMF-IncQuery