SlideShare a Scribd company logo
Graph-based Detection of
       Library API Imitations


      Chengnian Sun, Siau-Cheng Khoo, Shao Jie Zhang
                      National University of Singapore




1                                      October 6, 2011
Motivation – Software Libraries
       Common practice to employ 3rd-party software libraries
           Providing certain functionalities / hiding implementation details
                Improving productivity
           Well tested
                Enhancing program quality


       Application Programming Interfaces (APIs)
           Exported by libraries
           Ways for programmers to interact with libraries




    2                                                      October 6, 2011
Motivation – Problem
       APIs are not always effectively used by programmers
           Imitation: client code re-implements the behavior of library
            APIs

       Reasons
           Unfamiliar with the library,
           Library evolution


       Cost
           Waste unnecessary resources, time and energy
           Error-prone, software maintenance issue

    3                                                    October 6, 2011
Motivation – Example from JBoss




4                          October 6, 2011
Motivation – Example from JBoss
Imitation (1): method.getInterceptors() == null ||
                              method.getInterceptors().length < 1




5                                               October 6, 2011
Motivation – Example from JBoss
Imitation (1): method.getInterceptors() == null ||
                              method.getInterceptors().length < 1




API: return (interceptors != null && interceptors.length > 0)


6                                                 October 6, 2011
Motivation – Example from JBoss
Imitation (1): method.getInterceptors() == null ||
                              method.getInterceptors().length < 1




Refactor to: !method.hasAdvices()


7                                               October 6, 2011
Motivation – Example from JBoss
Imitation (1): method.getInterceptors() == null ||
                              method.getInterceptors().length < 1




Refactor to: !method.hasAdvices()


8                                               October 6, 2011
Motivation
       A library API imitation can be
           Not exactly the same
           Inter-procedural




    9                                    October 6, 2011
Motivation
    A library API imitation can be
        Not exactly the same
        Inter-procedural
    Goal: to accurately detect such imitations




    10                                            October 6, 2011
Detection of Library API Imitations
    Motivation
    Definitions
        Data Dependency Graph
        Trace & Subtrace
        Trace Subsumption
        Potential Imitation
    Algorithms
    Pre- & Post-processing
    Case Studies
    Conclusion

    11                           October 6, 2011
Definitions – Overview
    Employing Data Dependency Graphs (DDG) to represent
     code
        Semantic representation
        Capturing data flows within a method
        Carrying a portion of control flow information


    A library DDG is trace-subsumed by a client DDG 
     potential API imitation
        Relaxation of sub-graph isomorphism
        More efficient
        Minor-difference tolerant

    12                                               October 6, 2011
Definitions – Data Dependency Graph
    DDG – a graphical representation of a method

    Vertices: basic statements (three address form)

    Edges v  u: direction represents data dependency
        vertex u is data dependent on vertex v
        a variable var
            defined at v
            used at u
        and there is an execution path P from v to u, and along P, the
         var is not redefined.

    13                                                 October 6, 2011
Definitions – Trace & Subtrace
    A trace in a data dependency graph
        A path of vertices, <v1, v2, …, vm>
        The first vertex is an entry of the graph




    14                                               October 6, 2011
Definitions – Trace & Subtrace
    A trace in a data dependency graph               T1 = <C, D, E>
        A path of vertices, <v1, v2, …, vm>          T2 = <A, B, C, D, E, F>

        The first vertex is an entry of the graph

    Given two traces T1 = <v1, v2, …, vm> and T2 = <u1, u2, …, un>,T1
     is a subtrace of T2 (T1 ≤ T2) if there exists an integer i,
       0≤i≤n–m
       match(v1, u1 + i), match(v2, u2 + i), …, match(vm, um + i)



    Subtrace is a generalization of substring relation.


    15                                                October 6, 2011
Definitions – Trace & Subtrace
    A trace in a data dependency graph               T1 = <C, D, E>
        A path of vertices, <v1, v2, …, vm>          T2 = <A, B, C, D, E, F>
                                                      i=2
        The first vertex is an entry of the graph

    Given two traces T1 = <v1, v2, …, vm> and T2 = <u1, u2, …, un>,T1
     is a subtrace of T2 (T1 ≤ T2) if there exists an integer i,
       0≤i≤n–m
       match(v1, u1 + i), match(v2, u2 + i), …, match(vm, um + i)



    Subtrace is a generalization of substring relation.


    16                                                October 6, 2011
Definitions – Trace Subsumption
    A data dependency graph Glib
    A data dependency graph Gclt
    Gclt trace subsumes Glib , if and only if
        for each trace                there exists at least one trace
                          such that   is a subtrace of




    17                                               October 6, 2011
Definitions – Potential Imitation
    A client method Clt potentially imitates a library
     method Lib, if

        A DDG Gclt of Clt, resulting from inlining zero or some
         method calls into Clt

        A DDG Glib of Lib, resulting from inlining zero or some
         method calls into Lib

        Gclt trace subsumes Glib



    18                                               October 6, 2011
Detection of Library API Imitations
    Motivation
    Definitions
    Algorithms
        Overall Algorithm
        Trace Subsumption Checking
    Pre- & Post-processing
    Case Studies
    Conclusion




    19                                October 6, 2011
Algorithms – Overall Algorithm
    Input
        A library API Lib
        A client method Clt
        A set S of all method calls in both Lib and Clt
    Output true if Clt potentially imitates Lib
    Body
              for each sub-set s of S {
                 Lib’ = a copy of Lib with calls in s inlined
                 Clt’ = a copy of Clt with calls in s inlined
                 if the DDG of Clt’ trace subsumes the DDG of Lib’
                     return true
              }
              return false;


    20                                                         October 6, 2011
Algorithms – Trace Subsumption
    Input
        A DDG of a library API Glib
        A DDG of a client method Gclt

    Output
        true if Gclt trace subsumes Glib

    Depth-first Search,
    Step-by-step checking



    21                                      October 6, 2011
Algorithms – An Example
                          Stack:




                          Current:




22                        October 6, 2011
Algorithms – An Example
Locating all vertices in client matching each entry of the library   Stack:     (A, {A, A})




                                                                     Current:




 23                                                                  October 6, 2011
Algorithms – An Example
Locating client vertices matching library A’s successor D   Stack:




                                                            Current: (A, {A, A})




 24                                                         October 6, 2011
Algorithms – An Example
Locating client vertices matching library A’s successor D   Stack:       (D, {D})




                                                            Current: (A, {A, A})




 25                                                         October 6, 2011
Algorithms – An Example
Locating client vertices matching library A’s successor B   Stack:       (D, {D})




                                                            Current: (A, {A, A})




 26                                                         October 6, 2011
Algorithms – An Example
Locating client vertices matching library A’s successor B   Stack:       (B, {B})
                                                                         (D, {D})




                                                            Current: (A, {A, A})




 27                                                         October 6, 2011
Algorithms – An Example
Locating client vertices matching B’s successor {} in library   Stack:       (D, {D})




                                                                Current: (B, {B})




 28                                                             October 6, 2011
Algorithms – An Example
Locating client vertices matching library D’s successor M   Stack:




                                                            Current: (D, {D})




 29                                                         October 6, 2011
Detection of Library API Imitations
    Motivation
    Definitions
    Algorithms
    Pre-processing & Post-validation
    Case Studies
    Conclusion




    30                                  October 6, 2011
Pre-processing Libraries
    Remove nullness checks
                   If (a ==) {
                       return Constant;
                   } else {
                       a.XXX();
                   }
    Remove assertions
                   if (…)
                       throw Exception();
                   …….
    Remove exception handlers
                    try {

                    } catch (…) {}

    31                                      October 6, 2011
Post-validating Reported Imitations
    Reject the following two cases
        Unmatched Inlined Vertices in Client




        Matching All References to Library Locals




    32                                               October 6, 2011
Detection of Library API Imitations
    Motivation
    Definitions
    Algorithms
    Pre-processing & Post-validation
    Case Studies
    Conclusion




    33                                  October 6, 2011
Case Studies
    Evaluation measure



    Subjects – 10 open-source Java projects

    Testbed:
        Intel Core 2 Quad CPU 3.00GHz and 8GB memory




    34                                         October 6, 2011
Case Studies – Two Experiments
    Detecting Imitations of Imported Libraries
        Testing all method pairs (lib, clt), where the declaring class of
         lib is already imported in the client class
        Precision = 313 / 383 = 82%
        Runtime = 314 seconds




    35                                                   October 6, 2011
Case Studies – Two Experiments
    Detecting Imitations of Imported Libraries
        Testing all method pairs (lib, clt), where the declaring class of
         lib is already imported in the client class
        Precision = 313 / 383 = 82%
        Runtime = 314 seconds

    Detecting Imitations of Static Libraries
        Testing all method pairs (lib, clt), where lib is a public static
         method
        Precision = 116 / 155 = 75%
        Runtime = 396 seconds


    36                                                    October 6, 2011
Case Studies – Example of Static API




37                           October 6, 2011
Conclusion
    A common practice to employ 3rd party software libraries

    Client code re-implements behavior of existing APIs

    An algorithm based on data dependency graphs to detect
     complex imitations

    Average precision 82% & 75%




    38                                        October 6, 2011
Thank you.

       Q&A




39                October 6, 2011

More Related Content

What's hot

Java 8 - Project Lambda
Java 8 - Project LambdaJava 8 - Project Lambda
Java 8 - Project Lambda
Rahman USTA
 
Programming with Lambda Expressions in Java
Programming with Lambda Expressions in Java Programming with Lambda Expressions in Java
Programming with Lambda Expressions in Java
langer4711
 
Lambdas And Streams Hands On Lab
Lambdas And Streams Hands On LabLambdas And Streams Hands On Lab
Lambdas And Streams Hands On Lab
Simon Ritter
 
Java 8
Java 8Java 8
Java 8
vilniusjug
 
Major Java 8 features
Major Java 8 featuresMajor Java 8 features
Major Java 8 features
Sanjoy Kumar Roy
 
Java SE 8
Java SE 8Java SE 8
Java SE 8
Simon Ritter
 
Java SE 8 - New Features
Java SE 8 - New FeaturesJava SE 8 - New Features
Java SE 8 - New Features
Naveen Hegde
 
Java 8 lambda
Java 8 lambdaJava 8 lambda
Java 8 lambda
Manav Prasad
 
Java 8 streams
Java 8 streamsJava 8 streams
Java 8 streams
Manav Prasad
 
JDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
JDK8 Lambdas and Streams: Changing The Way You Think When Developing JavaJDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
JDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
Simon Ritter
 

What's hot (11)

java8
java8java8
java8
 
Java 8 - Project Lambda
Java 8 - Project LambdaJava 8 - Project Lambda
Java 8 - Project Lambda
 
Programming with Lambda Expressions in Java
Programming with Lambda Expressions in Java Programming with Lambda Expressions in Java
Programming with Lambda Expressions in Java
 
Lambdas And Streams Hands On Lab
Lambdas And Streams Hands On LabLambdas And Streams Hands On Lab
Lambdas And Streams Hands On Lab
 
Java 8
Java 8Java 8
Java 8
 
Major Java 8 features
Major Java 8 featuresMajor Java 8 features
Major Java 8 features
 
Java SE 8
Java SE 8Java SE 8
Java SE 8
 
Java SE 8 - New Features
Java SE 8 - New FeaturesJava SE 8 - New Features
Java SE 8 - New Features
 
Java 8 lambda
Java 8 lambdaJava 8 lambda
Java 8 lambda
 
Java 8 streams
Java 8 streamsJava 8 streams
Java 8 streams
 
JDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
JDK8 Lambdas and Streams: Changing The Way You Think When Developing JavaJDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
JDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
 

Viewers also liked

Components - Crossing the Boundaries while Analyzing Heterogeneous Component-...
Components - Crossing the Boundaries while Analyzing Heterogeneous Component-...Components - Crossing the Boundaries while Analyzing Heterogeneous Component-...
Components - Crossing the Boundaries while Analyzing Heterogeneous Component-...
ICSM 2011
 
Natural Language Analysis - Mining Java Class Naming Conventions
Natural Language Analysis - Mining Java Class Naming ConventionsNatural Language Analysis - Mining Java Class Naming Conventions
Natural Language Analysis - Mining Java Class Naming Conventions
ICSM 2011
 
Industry - Evolution and migration - Incremental and Iterative Reengineering ...
Industry - Evolution and migration - Incremental and Iterative Reengineering ...Industry - Evolution and migration - Incremental and Iterative Reengineering ...
Industry - Evolution and migration - Incremental and Iterative Reengineering ...
ICSM 2011
 
ERA Poster - Measuring Disruption from Software Evolution Activities Using Gr...
ERA Poster - Measuring Disruption from Software Evolution Activities Using Gr...ERA Poster - Measuring Disruption from Software Evolution Activities Using Gr...
ERA Poster - Measuring Disruption from Software Evolution Activities Using Gr...
ICSM 2011
 
Industry - Testing & Quality Assurance in Data Migration Projects
Industry - Testing & Quality Assurance in Data Migration Projects Industry - Testing & Quality Assurance in Data Migration Projects
Industry - Testing & Quality Assurance in Data Migration Projects
ICSM 2011
 
Traceability - Structural Conformance Checking with Design Tests: An Evaluati...
Traceability - Structural Conformance Checking with Design Tests: An Evaluati...Traceability - Structural Conformance Checking with Design Tests: An Evaluati...
Traceability - Structural Conformance Checking with Design Tests: An Evaluati...
ICSM 2011
 
ERA - Tracking Technical Debt
ERA - Tracking Technical DebtERA - Tracking Technical Debt
ERA - Tracking Technical Debt
ICSM 2011
 
Reliability and Quality - Predicting post-release defects using pre-release f...
Reliability and Quality - Predicting post-release defects using pre-release f...Reliability and Quality - Predicting post-release defects using pre-release f...
Reliability and Quality - Predicting post-release defects using pre-release f...
ICSM 2011
 
Faults and Regression testing - Localizing Failure-Inducing Program Edits Bas...
Faults and Regression testing - Localizing Failure-Inducing Program Edits Bas...Faults and Regression testing - Localizing Failure-Inducing Program Edits Bas...
Faults and Regression testing - Localizing Failure-Inducing Program Edits Bas...
ICSM 2011
 
Industry - Estimating software maintenance effort from use cases an indu...
Industry - Estimating software maintenance effort from use cases an      indu...Industry - Estimating software maintenance effort from use cases an      indu...
Industry - Estimating software maintenance effort from use cases an indu...
ICSM 2011
 
Postdoc Symposium - Abram Hindle
Postdoc Symposium - Abram HindlePostdoc Symposium - Abram Hindle
Postdoc Symposium - Abram Hindle
ICSM 2011
 
Migration and Refactoring - Identifying Overly Strong Conditions in Refactori...
Migration and Refactoring - Identifying Overly Strong Conditions in Refactori...Migration and Refactoring - Identifying Overly Strong Conditions in Refactori...
Migration and Refactoring - Identifying Overly Strong Conditions in Refactori...
ICSM 2011
 
Metrics - You can't control the unfamiliar
Metrics - You can't control the unfamiliarMetrics - You can't control the unfamiliar
Metrics - You can't control the unfamiliar
ICSM 2011
 
Faults and Regression Testing - Fault interaction and its repercussions
Faults and Regression Testing - Fault interaction and its repercussionsFaults and Regression Testing - Fault interaction and its repercussions
Faults and Regression Testing - Fault interaction and its repercussions
ICSM 2011
 
ERA - Measuring Disruption from Software Evolution Activities Using Graph-Bas...
ERA - Measuring Disruption from Software Evolution Activities Using Graph-Bas...ERA - Measuring Disruption from Software Evolution Activities Using Graph-Bas...
ERA - Measuring Disruption from Software Evolution Activities Using Graph-Bas...
ICSM 2011
 
Industry - Precise Detection of Un-Initialized Variables in Large, Real-life ...
Industry - Precise Detection of Un-Initialized Variables in Large, Real-life ...Industry - Precise Detection of Un-Initialized Variables in Large, Real-life ...
Industry - Precise Detection of Un-Initialized Variables in Large, Real-life ...
ICSM 2011
 
Natural Language Analysis - Expanding Identifiers to Normalize Source Code Vo...
Natural Language Analysis - Expanding Identifiers to Normalize Source Code Vo...Natural Language Analysis - Expanding Identifiers to Normalize Source Code Vo...
Natural Language Analysis - Expanding Identifiers to Normalize Source Code Vo...
ICSM 2011
 
Tutorial 2 - Practical Combinatorial (t-way) Methods for Detecting Complex Fa...
Tutorial 2 - Practical Combinatorial (t-way) Methods for Detecting Complex Fa...Tutorial 2 - Practical Combinatorial (t-way) Methods for Detecting Complex Fa...
Tutorial 2 - Practical Combinatorial (t-way) Methods for Detecting Complex Fa...
ICSM 2011
 
ERA - Measuring Maintainability of Spreadsheets in the Wild
ERA - Measuring Maintainability of Spreadsheets in the Wild ERA - Measuring Maintainability of Spreadsheets in the Wild
ERA - Measuring Maintainability of Spreadsheets in the Wild
ICSM 2011
 
Metrics - Using Source Code Metrics to Predict Change-Prone Java Interfaces
Metrics - Using Source Code Metrics to Predict Change-Prone Java InterfacesMetrics - Using Source Code Metrics to Predict Change-Prone Java Interfaces
Metrics - Using Source Code Metrics to Predict Change-Prone Java Interfaces
ICSM 2011
 

Viewers also liked (20)

Components - Crossing the Boundaries while Analyzing Heterogeneous Component-...
Components - Crossing the Boundaries while Analyzing Heterogeneous Component-...Components - Crossing the Boundaries while Analyzing Heterogeneous Component-...
Components - Crossing the Boundaries while Analyzing Heterogeneous Component-...
 
Natural Language Analysis - Mining Java Class Naming Conventions
Natural Language Analysis - Mining Java Class Naming ConventionsNatural Language Analysis - Mining Java Class Naming Conventions
Natural Language Analysis - Mining Java Class Naming Conventions
 
Industry - Evolution and migration - Incremental and Iterative Reengineering ...
Industry - Evolution and migration - Incremental and Iterative Reengineering ...Industry - Evolution and migration - Incremental and Iterative Reengineering ...
Industry - Evolution and migration - Incremental and Iterative Reengineering ...
 
ERA Poster - Measuring Disruption from Software Evolution Activities Using Gr...
ERA Poster - Measuring Disruption from Software Evolution Activities Using Gr...ERA Poster - Measuring Disruption from Software Evolution Activities Using Gr...
ERA Poster - Measuring Disruption from Software Evolution Activities Using Gr...
 
Industry - Testing & Quality Assurance in Data Migration Projects
Industry - Testing & Quality Assurance in Data Migration Projects Industry - Testing & Quality Assurance in Data Migration Projects
Industry - Testing & Quality Assurance in Data Migration Projects
 
Traceability - Structural Conformance Checking with Design Tests: An Evaluati...
Traceability - Structural Conformance Checking with Design Tests: An Evaluati...Traceability - Structural Conformance Checking with Design Tests: An Evaluati...
Traceability - Structural Conformance Checking with Design Tests: An Evaluati...
 
ERA - Tracking Technical Debt
ERA - Tracking Technical DebtERA - Tracking Technical Debt
ERA - Tracking Technical Debt
 
Reliability and Quality - Predicting post-release defects using pre-release f...
Reliability and Quality - Predicting post-release defects using pre-release f...Reliability and Quality - Predicting post-release defects using pre-release f...
Reliability and Quality - Predicting post-release defects using pre-release f...
 
Faults and Regression testing - Localizing Failure-Inducing Program Edits Bas...
Faults and Regression testing - Localizing Failure-Inducing Program Edits Bas...Faults and Regression testing - Localizing Failure-Inducing Program Edits Bas...
Faults and Regression testing - Localizing Failure-Inducing Program Edits Bas...
 
Industry - Estimating software maintenance effort from use cases an indu...
Industry - Estimating software maintenance effort from use cases an      indu...Industry - Estimating software maintenance effort from use cases an      indu...
Industry - Estimating software maintenance effort from use cases an indu...
 
Postdoc Symposium - Abram Hindle
Postdoc Symposium - Abram HindlePostdoc Symposium - Abram Hindle
Postdoc Symposium - Abram Hindle
 
Migration and Refactoring - Identifying Overly Strong Conditions in Refactori...
Migration and Refactoring - Identifying Overly Strong Conditions in Refactori...Migration and Refactoring - Identifying Overly Strong Conditions in Refactori...
Migration and Refactoring - Identifying Overly Strong Conditions in Refactori...
 
Metrics - You can't control the unfamiliar
Metrics - You can't control the unfamiliarMetrics - You can't control the unfamiliar
Metrics - You can't control the unfamiliar
 
Faults and Regression Testing - Fault interaction and its repercussions
Faults and Regression Testing - Fault interaction and its repercussionsFaults and Regression Testing - Fault interaction and its repercussions
Faults and Regression Testing - Fault interaction and its repercussions
 
ERA - Measuring Disruption from Software Evolution Activities Using Graph-Bas...
ERA - Measuring Disruption from Software Evolution Activities Using Graph-Bas...ERA - Measuring Disruption from Software Evolution Activities Using Graph-Bas...
ERA - Measuring Disruption from Software Evolution Activities Using Graph-Bas...
 
Industry - Precise Detection of Un-Initialized Variables in Large, Real-life ...
Industry - Precise Detection of Un-Initialized Variables in Large, Real-life ...Industry - Precise Detection of Un-Initialized Variables in Large, Real-life ...
Industry - Precise Detection of Un-Initialized Variables in Large, Real-life ...
 
Natural Language Analysis - Expanding Identifiers to Normalize Source Code Vo...
Natural Language Analysis - Expanding Identifiers to Normalize Source Code Vo...Natural Language Analysis - Expanding Identifiers to Normalize Source Code Vo...
Natural Language Analysis - Expanding Identifiers to Normalize Source Code Vo...
 
Tutorial 2 - Practical Combinatorial (t-way) Methods for Detecting Complex Fa...
Tutorial 2 - Practical Combinatorial (t-way) Methods for Detecting Complex Fa...Tutorial 2 - Practical Combinatorial (t-way) Methods for Detecting Complex Fa...
Tutorial 2 - Practical Combinatorial (t-way) Methods for Detecting Complex Fa...
 
ERA - Measuring Maintainability of Spreadsheets in the Wild
ERA - Measuring Maintainability of Spreadsheets in the Wild ERA - Measuring Maintainability of Spreadsheets in the Wild
ERA - Measuring Maintainability of Spreadsheets in the Wild
 
Metrics - Using Source Code Metrics to Predict Change-Prone Java Interfaces
Metrics - Using Source Code Metrics to Predict Change-Prone Java InterfacesMetrics - Using Source Code Metrics to Predict Change-Prone Java Interfaces
Metrics - Using Source Code Metrics to Predict Change-Prone Java Interfaces
 

Similar to Components - Graph Based Detection of Library API Limitations

10.1.1.70.8789
10.1.1.70.878910.1.1.70.8789
10.1.1.70.8789
Hoài Bùi
 
OntoMaven Repositories and OMG API4KP
OntoMaven Repositories and OMG API4KPOntoMaven Repositories and OMG API4KP
OntoMaven Repositories and OMG API4KP
Aksw Group
 
Biperpedia: An ontology of Search Application
Biperpedia: An ontology of Search ApplicationBiperpedia: An ontology of Search Application
Biperpedia: An ontology of Search Application
Harsh Kevadia
 
Python array API standardization - current state and benefits
Python array API standardization - current state and benefitsPython array API standardization - current state and benefits
Python array API standardization - current state and benefits
Ralf Gommers
 
Syntactic Mediation in Grid and Web Service Architectures
Syntactic Mediation in Grid and Web Service ArchitecturesSyntactic Mediation in Grid and Web Service Architectures
Syntactic Mediation in Grid and Web Service ArchitecturesMartin Szomszor
 
Learning spark ch11 - Machine Learning with MLlib
Learning spark ch11 - Machine Learning with MLlibLearning spark ch11 - Machine Learning with MLlib
Learning spark ch11 - Machine Learning with MLlib
phanleson
 
Java 8
Java 8Java 8
Container Classes
Container ClassesContainer Classes
Container Classes
adil raja
 
Collaborative filtering20081111
Collaborative filtering20081111Collaborative filtering20081111
Collaborative filtering20081111
greatwnag
 
Concepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming LanguagesConcepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming Languages
ppd1961
 
MLlib: Spark's Machine Learning Library
MLlib: Spark's Machine Learning LibraryMLlib: Spark's Machine Learning Library
MLlib: Spark's Machine Learning Library
jeykottalam
 
Generics
GenericsGenerics
Generics
adil raja
 
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
Coen De Roover
 
Slides 111017220255-phpapp01
Slides 111017220255-phpapp01Slides 111017220255-phpapp01
Slides 111017220255-phpapp01Ken Mwai
 
Python for Financial Data Analysis with pandas
Python for Financial Data Analysis with pandasPython for Financial Data Analysis with pandas
Python for Financial Data Analysis with pandasWes McKinney
 
An Efficient and Parallel Abstract Interpreter in Scala — Presentation
An Efficient and Parallel Abstract Interpreter in Scala — PresentationAn Efficient and Parallel Abstract Interpreter in Scala — Presentation
An Efficient and Parallel Abstract Interpreter in Scala — Presentation
🌳 Olivier Pirson — OPi 🇧🇪🇫🇷🇬🇧 🐧 👨‍💻 👨‍🔬
 
SF Python Meetup: TextRank in Python
SF Python Meetup: TextRank in PythonSF Python Meetup: TextRank in Python
SF Python Meetup: TextRank in Python
Paco Nathan
 
Charles Sharp: Java 8 Streams
Charles Sharp: Java 8 StreamsCharles Sharp: Java 8 Streams
Charles Sharp: Java 8 Streams
jessitron
 
Automatic Migration of Legacy Java Method Implementations to Interfaces
Automatic Migration of Legacy Java Method Implementations to InterfacesAutomatic Migration of Legacy Java Method Implementations to Interfaces
Automatic Migration of Legacy Java Method Implementations to Interfaces
Raffi Khatchadourian
 

Similar to Components - Graph Based Detection of Library API Limitations (20)

10.1.1.70.8789
10.1.1.70.878910.1.1.70.8789
10.1.1.70.8789
 
OntoMaven Repositories and OMG API4KP
OntoMaven Repositories and OMG API4KPOntoMaven Repositories and OMG API4KP
OntoMaven Repositories and OMG API4KP
 
Biperpedia: An ontology of Search Application
Biperpedia: An ontology of Search ApplicationBiperpedia: An ontology of Search Application
Biperpedia: An ontology of Search Application
 
Python array API standardization - current state and benefits
Python array API standardization - current state and benefitsPython array API standardization - current state and benefits
Python array API standardization - current state and benefits
 
Syntactic Mediation in Grid and Web Service Architectures
Syntactic Mediation in Grid and Web Service ArchitecturesSyntactic Mediation in Grid and Web Service Architectures
Syntactic Mediation in Grid and Web Service Architectures
 
Learning spark ch11 - Machine Learning with MLlib
Learning spark ch11 - Machine Learning with MLlibLearning spark ch11 - Machine Learning with MLlib
Learning spark ch11 - Machine Learning with MLlib
 
Java 8
Java 8Java 8
Java 8
 
Container Classes
Container ClassesContainer Classes
Container Classes
 
Collaborative filtering20081111
Collaborative filtering20081111Collaborative filtering20081111
Collaborative filtering20081111
 
Concepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming LanguagesConcepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming Languages
 
MLlib: Spark's Machine Learning Library
MLlib: Spark's Machine Learning LibraryMLlib: Spark's Machine Learning Library
MLlib: Spark's Machine Learning Library
 
Generics
GenericsGenerics
Generics
 
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
 
Slides 111017220255-phpapp01
Slides 111017220255-phpapp01Slides 111017220255-phpapp01
Slides 111017220255-phpapp01
 
Python for Financial Data Analysis with pandas
Python for Financial Data Analysis with pandasPython for Financial Data Analysis with pandas
Python for Financial Data Analysis with pandas
 
An Efficient and Parallel Abstract Interpreter in Scala — Presentation
An Efficient and Parallel Abstract Interpreter in Scala — PresentationAn Efficient and Parallel Abstract Interpreter in Scala — Presentation
An Efficient and Parallel Abstract Interpreter in Scala — Presentation
 
SF Python Meetup: TextRank in Python
SF Python Meetup: TextRank in PythonSF Python Meetup: TextRank in Python
SF Python Meetup: TextRank in Python
 
Charles Sharp: Java 8 Streams
Charles Sharp: Java 8 StreamsCharles Sharp: Java 8 Streams
Charles Sharp: Java 8 Streams
 
Wi presentation
Wi presentationWi presentation
Wi presentation
 
Automatic Migration of Legacy Java Method Implementations to Interfaces
Automatic Migration of Legacy Java Method Implementations to InterfacesAutomatic Migration of Legacy Java Method Implementations to Interfaces
Automatic Migration of Legacy Java Method Implementations to Interfaces
 

Recently uploaded

From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 

Recently uploaded (20)

From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 

Components - Graph Based Detection of Library API Limitations

  • 1. Graph-based Detection of Library API Imitations Chengnian Sun, Siau-Cheng Khoo, Shao Jie Zhang National University of Singapore 1 October 6, 2011
  • 2. Motivation – Software Libraries  Common practice to employ 3rd-party software libraries  Providing certain functionalities / hiding implementation details   Improving productivity  Well tested   Enhancing program quality  Application Programming Interfaces (APIs)  Exported by libraries  Ways for programmers to interact with libraries 2 October 6, 2011
  • 3. Motivation – Problem  APIs are not always effectively used by programmers  Imitation: client code re-implements the behavior of library APIs  Reasons  Unfamiliar with the library,  Library evolution  Cost  Waste unnecessary resources, time and energy  Error-prone, software maintenance issue 3 October 6, 2011
  • 4. Motivation – Example from JBoss 4 October 6, 2011
  • 5. Motivation – Example from JBoss Imitation (1): method.getInterceptors() == null || method.getInterceptors().length < 1 5 October 6, 2011
  • 6. Motivation – Example from JBoss Imitation (1): method.getInterceptors() == null || method.getInterceptors().length < 1 API: return (interceptors != null && interceptors.length > 0) 6 October 6, 2011
  • 7. Motivation – Example from JBoss Imitation (1): method.getInterceptors() == null || method.getInterceptors().length < 1 Refactor to: !method.hasAdvices() 7 October 6, 2011
  • 8. Motivation – Example from JBoss Imitation (1): method.getInterceptors() == null || method.getInterceptors().length < 1 Refactor to: !method.hasAdvices() 8 October 6, 2011
  • 9. Motivation  A library API imitation can be  Not exactly the same  Inter-procedural 9 October 6, 2011
  • 10. Motivation  A library API imitation can be  Not exactly the same  Inter-procedural  Goal: to accurately detect such imitations 10 October 6, 2011
  • 11. Detection of Library API Imitations  Motivation  Definitions  Data Dependency Graph  Trace & Subtrace  Trace Subsumption  Potential Imitation  Algorithms  Pre- & Post-processing  Case Studies  Conclusion 11 October 6, 2011
  • 12. Definitions – Overview  Employing Data Dependency Graphs (DDG) to represent code  Semantic representation  Capturing data flows within a method  Carrying a portion of control flow information  A library DDG is trace-subsumed by a client DDG  potential API imitation  Relaxation of sub-graph isomorphism  More efficient  Minor-difference tolerant 12 October 6, 2011
  • 13. Definitions – Data Dependency Graph  DDG – a graphical representation of a method  Vertices: basic statements (three address form)  Edges v  u: direction represents data dependency  vertex u is data dependent on vertex v  a variable var  defined at v  used at u  and there is an execution path P from v to u, and along P, the var is not redefined. 13 October 6, 2011
  • 14. Definitions – Trace & Subtrace  A trace in a data dependency graph  A path of vertices, <v1, v2, …, vm>  The first vertex is an entry of the graph 14 October 6, 2011
  • 15. Definitions – Trace & Subtrace  A trace in a data dependency graph T1 = <C, D, E>  A path of vertices, <v1, v2, …, vm> T2 = <A, B, C, D, E, F>  The first vertex is an entry of the graph  Given two traces T1 = <v1, v2, …, vm> and T2 = <u1, u2, …, un>,T1 is a subtrace of T2 (T1 ≤ T2) if there exists an integer i,  0≤i≤n–m  match(v1, u1 + i), match(v2, u2 + i), …, match(vm, um + i)  Subtrace is a generalization of substring relation. 15 October 6, 2011
  • 16. Definitions – Trace & Subtrace  A trace in a data dependency graph T1 = <C, D, E>  A path of vertices, <v1, v2, …, vm> T2 = <A, B, C, D, E, F> i=2  The first vertex is an entry of the graph  Given two traces T1 = <v1, v2, …, vm> and T2 = <u1, u2, …, un>,T1 is a subtrace of T2 (T1 ≤ T2) if there exists an integer i,  0≤i≤n–m  match(v1, u1 + i), match(v2, u2 + i), …, match(vm, um + i)  Subtrace is a generalization of substring relation. 16 October 6, 2011
  • 17. Definitions – Trace Subsumption  A data dependency graph Glib  A data dependency graph Gclt  Gclt trace subsumes Glib , if and only if  for each trace there exists at least one trace such that is a subtrace of 17 October 6, 2011
  • 18. Definitions – Potential Imitation  A client method Clt potentially imitates a library method Lib, if  A DDG Gclt of Clt, resulting from inlining zero or some method calls into Clt  A DDG Glib of Lib, resulting from inlining zero or some method calls into Lib  Gclt trace subsumes Glib 18 October 6, 2011
  • 19. Detection of Library API Imitations  Motivation  Definitions  Algorithms  Overall Algorithm  Trace Subsumption Checking  Pre- & Post-processing  Case Studies  Conclusion 19 October 6, 2011
  • 20. Algorithms – Overall Algorithm  Input  A library API Lib  A client method Clt  A set S of all method calls in both Lib and Clt  Output true if Clt potentially imitates Lib  Body for each sub-set s of S { Lib’ = a copy of Lib with calls in s inlined Clt’ = a copy of Clt with calls in s inlined if the DDG of Clt’ trace subsumes the DDG of Lib’ return true } return false; 20 October 6, 2011
  • 21. Algorithms – Trace Subsumption  Input  A DDG of a library API Glib  A DDG of a client method Gclt  Output  true if Gclt trace subsumes Glib  Depth-first Search,  Step-by-step checking 21 October 6, 2011
  • 22. Algorithms – An Example Stack: Current: 22 October 6, 2011
  • 23. Algorithms – An Example Locating all vertices in client matching each entry of the library Stack: (A, {A, A}) Current: 23 October 6, 2011
  • 24. Algorithms – An Example Locating client vertices matching library A’s successor D Stack: Current: (A, {A, A}) 24 October 6, 2011
  • 25. Algorithms – An Example Locating client vertices matching library A’s successor D Stack: (D, {D}) Current: (A, {A, A}) 25 October 6, 2011
  • 26. Algorithms – An Example Locating client vertices matching library A’s successor B Stack: (D, {D}) Current: (A, {A, A}) 26 October 6, 2011
  • 27. Algorithms – An Example Locating client vertices matching library A’s successor B Stack: (B, {B}) (D, {D}) Current: (A, {A, A}) 27 October 6, 2011
  • 28. Algorithms – An Example Locating client vertices matching B’s successor {} in library Stack: (D, {D}) Current: (B, {B}) 28 October 6, 2011
  • 29. Algorithms – An Example Locating client vertices matching library D’s successor M Stack: Current: (D, {D}) 29 October 6, 2011
  • 30. Detection of Library API Imitations  Motivation  Definitions  Algorithms  Pre-processing & Post-validation  Case Studies  Conclusion 30 October 6, 2011
  • 31. Pre-processing Libraries  Remove nullness checks If (a ==) { return Constant; } else { a.XXX(); }  Remove assertions if (…) throw Exception(); …….  Remove exception handlers try { } catch (…) {} 31 October 6, 2011
  • 32. Post-validating Reported Imitations  Reject the following two cases  Unmatched Inlined Vertices in Client  Matching All References to Library Locals 32 October 6, 2011
  • 33. Detection of Library API Imitations  Motivation  Definitions  Algorithms  Pre-processing & Post-validation  Case Studies  Conclusion 33 October 6, 2011
  • 34. Case Studies  Evaluation measure  Subjects – 10 open-source Java projects  Testbed:  Intel Core 2 Quad CPU 3.00GHz and 8GB memory 34 October 6, 2011
  • 35. Case Studies – Two Experiments  Detecting Imitations of Imported Libraries  Testing all method pairs (lib, clt), where the declaring class of lib is already imported in the client class  Precision = 313 / 383 = 82%  Runtime = 314 seconds 35 October 6, 2011
  • 36. Case Studies – Two Experiments  Detecting Imitations of Imported Libraries  Testing all method pairs (lib, clt), where the declaring class of lib is already imported in the client class  Precision = 313 / 383 = 82%  Runtime = 314 seconds  Detecting Imitations of Static Libraries  Testing all method pairs (lib, clt), where lib is a public static method  Precision = 116 / 155 = 75%  Runtime = 396 seconds 36 October 6, 2011
  • 37. Case Studies – Example of Static API 37 October 6, 2011
  • 38. Conclusion  A common practice to employ 3rd party software libraries  Client code re-implements behavior of existing APIs  An algorithm based on data dependency graphs to detect complex imitations  Average precision 82% & 75% 38 October 6, 2011
  • 39. Thank you. Q&A 39 October 6, 2011