Dimensions of Knowledge in API Migration Thiago Bartolomei, Mahdi - - PowerPoint PPT Presentation
Dimensions of Knowledge in API Migration Thiago Bartolomei, Mahdi - - PowerPoint PPT Presentation
Combining Multiple Dimensions of Knowledge in API Migration Thiago Bartolomei, Mahdi Derakhshanmanesh, Andreas Fuhr, Peter Koch, Mathias Konrath, Ralf Lmmel, Heiko Winnebeck Contribution of this presentation Present a framework combining
Contribution of this presentation
Present a framework combining multiple dimensions of knowledge to support API migration.
2
API Migration
- Special case of software migration
- Adapt software system to
– replace old API (source API) by – new API (target API) – of the same domain (e.g., GUI development)
3
Why API Migration?
- Legacy APIs may be
– outdated, not supported anymore
- New APIs may provide
– new features – better performance, reliability, usability, … – support for new system environments
4
Why API Migration: Example
5
SwingWT
- Style
Swing SWT
Why API Migration: Example
6
Swing SWT
SWTSwing
- Compability
API Migration Approaches
7
?
API Migration: Reeimplentation
8
API Migration: Transformation
9
API Migration: Wrapping
10
Roadmap
- Integrated Repository
– Multiple dimensions of knowledge
- Wrapper Assessment
– How to rate wrappers on their suitability?
- Guidance for Migration
– How to extend/write own wrappers/transformations?
11
INTEGRATED REPOSITORY
12
Metamodel
- Simplified Java
sources
- API Usage properties
- f 1476 SourceForge
projects
- Ontology on API
concepts
13
Repository Technology: TGraphs
14
Repository Technology: Graph Querying with GReQL
from clsApi: V{Class} with clsApi.qualifiedName =~ “javax\.swing\..*" and count(clsApi-->{CorrespondsTo}) > 0 reportSet clsApi end
WRAPPER ASSESSMENT
16
Wrapper Assessment: Goals
- Compare different wrappers for same
wrapping task
- Track development of own wrappers
17
Wrapper Assessment: Source API Coverage
SwingWT
25 533 4533 7 2331 12506 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% Packages Classes Methods Implemented Unimplemented
SWTSwing
16 372 3426 15 281 4618 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% Packages Classes Methods Implemented Unimplemented
18
Wrapper Assessment: Wrapper Compliance
- Simple coverage statistics do not cover
more complex dependencies
– Declarations in supertypes – Empty implementations
- Simple covarage does not reflect usage of
APIs in real projects
19
Compliance: Declarations on supertypes
SwingWT
74% 22% 4%
Missing methods
Class missing Class present
- Impl. in supertype
SWTSwing
20
78% 19% 3%
Missing methods
Class missing Class present
- Impl. in supertype
Compliance: Empty methods
SwingWT SWTSwing
21
78% 22%
Implemented Methods
- Impl. methods
Empty methods 93% 7%
Implemented Methods
- Impl. methods
Empty methods
Wrapper Assessment: Relevance in Terms of Usage
SwingWT
26,6% 97,1% 73,4% 2,9% 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% Absolute Usage Implemented Unimplemented
SWTSwing
22
42,6% 97,7% 57,4% 2,4% 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% Absolute Usage Implemented Unimplemented
GUIDANCE FOR MIGRATION
23
Guidance for Migration: Goals
- Extend existing wrappers
- Write own wrappers / reimplementations /
transformations Identify target API code suited to implement source API methods
24
Guidance for Migration: Concept-based Method Candidates
25
Guidance for Migration: Assessment of the Ontology
SwingWT
10,8% 28,1% 89,2% 71,9% 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
- Unimpl. meth.
- Impl. meth.
With link Without link
SWTSwing
26
0,3% 25,0% 99,7% 75,0% 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
- Unimpl. meth.
- Impl. meth.
With link Without link
Guidance for Migration: Ontology Correctness
SwingWT
43% 57%
Methods with Links
Correct link Wrong link
SWTSwing
27
37% 63%
Methods with Links
Correct link Wrong link