Verifying Dependencies in Eclipse

63
Verifying Plugin Dependencies in Eclipse Shivanshu Singh [email protected] Carnegie Mellon University

description

Eclipse is a system of plugins, where multiple plugins come together to form any typical instance of the application. The core eclipse infrastructure is in itself a combination of plugins. With a large number of options available from a marketplace of plugins, where an end usr may choose to install just about any arbitrary mix of them on eclipse, ensuring compatibility between plugins in a chosen combination is important especially when considering that eclipse is now being used in all sorts of (sensitive and non-sensitive) contexts. In this talk I presented my ongoing work and experiences so far in checking if given a combination of plugins, all the stated dependencies of all the plugins are satisfied, and to see if any plugins have unnecessary, unstated or unsatisfied dependencies.

Transcript of Verifying Dependencies in Eclipse

Page 1: Verifying Dependencies in Eclipse

Verifying Plugin Dependencies

in Eclipse

Shivanshu Singh [email protected]

Carnegie Mellon University

Page 2: Verifying Dependencies in Eclipse

Plugin based systems are pretty mainstream

Deployed for serious commercial and noncommercial use

Closed World Open World

Marketplace of plugins

2

Page 3: Verifying Dependencies in Eclipse

3

Page 4: Verifying Dependencies in Eclipse

“ How do I debug the Eclipse Plugin error ‘Plugin was unable to load class’ ? ”

Missing dependencies not realized until its too late

http://stackover"ow.com/questions/648024/how-do-i-debug-the-eclipse-plugin-error-plugin-was-unable-to-load-class http://stackover"ow.com/questions/9128132/eclipse-plugin-install-error

http://androidforums.com/developer-101/543787-error-installing-adt-plugin-in-eclipse.html#post4343892 http://www.eclipsezone.com/eclipse/forums/t93278.rhtml http://stackover"ow.com/questions/1509511/eclipse-plugin-noclassde#ounderror-on-org-eclipse-jdt-ui-javaui

http://stackover"ow.com/questions/11514883/con"icting-dependencies-while-installing-adt-plugin-for-eclipse-helios

4

Page 5: Verifying Dependencies in Eclipse

5

Page 6: Verifying Dependencies in Eclipse

(ICSE 2012)

6

Page 7: Verifying Dependencies in Eclipse

“ We try to encapsulate the logic as much as

possible to be able to test with unit tests. What cannot be encapsulated is not tested.

7

Page 8: Verifying Dependencies in Eclipse

8

Plugin testing beyond unit testing is: annoying distracting painful

Lack of time, resources, infrastructure,

combinatorial complexity

Arbitrary dependency speci$cations

Too many plugins, too many versions

Page 9: Verifying Dependencies in Eclipse

9

Understanding user-speci$ed dependency speci$cations and how they

map to the actual implementation

Analysing artifacts for checking arbitrary dependency speci$cations

Compatibility across version ranges

Page 10: Verifying Dependencies in Eclipse

Objectives

10  

Page 11: Verifying Dependencies in Eclipse

Extract dependencies from the speci$cation and the implementation

Analyse them for satisfaction in the Implementation

Understand implied and/or unstated dependencies

Compatibility across various versions

11

Solution Space

Problem Space

Page 12: Verifying Dependencies in Eclipse

12

package org.some; public class A { public void fn() {....} public String foo(int a) {....} private int process() { B b = new B(); boolean flag = B.go(); C c=new C(); c.callfn(“hello”); } } ------------------------------------------ package org.someother; public class C { void callfn(String x) {....} }

package com.eother.some; public class B extends G { public boolean go() { return true; } } ------------------------------------------ package com.eother; public class G { .... }

Problem Space

Solution Scape

Page 13: Verifying Dependencies in Eclipse

OSGi, Eclipse Plugins, Features

13

Page 14: Verifying Dependencies in Eclipse

14

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

OSGi Plugin Manifest: UniqueName, Version Exports:

packages Imports:

libraries

Exported Package

Page 15: Verifying Dependencies in Eclipse

15

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

OSGi Plugin Manifest: UniqueName, Version Exports:

packages Imports:

libraries other plugins

Page 16: Verifying Dependencies in Eclipse

16

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

OSGi Plugin Manifest: UniqueName, Version Exports:

packages Imports:

libraries other plugins external packages

Exported Package

Page 17: Verifying Dependencies in Eclipse

17

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

OSGi Plugin Manifest: UniqueName, Version Exports:

packages Imports:

libraries other plugins external packages

Host: (opt. for fragments)

Page 18: Verifying Dependencies in Eclipse

18

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

OSGi Plugin Manifest: UniqueName, Version Exports:

packages Imports:

libraries other plugins external packages

Host: (opt. for fragments)

Page 19: Verifying Dependencies in Eclipse

19

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

FEATURE

feature.xml!

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar!

lib/jar !MANIFEST.MF !

PLUGIN

lib/jar!

lib/jar !lib/jar !

plugin.xml!

MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !lib/jar !

plugin.xml!

MANIFEST.MF !

PLUGIN lib/jar !

lib/jar !lib/jar !

plugin.xml!

MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !lib/jar !

plugin.xml!

MANIFEST.MF !

PLUGIN lib/jar !

lib/jar !lib/jar !

plugin.xml!

MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

OSGi Plugin Manifest: UniqueName, Version Exports:

packages Imports:

libraries other plugins external packages

Host: (opt. for fragments)

Eclipse Feature.xml: UniqueName, Version Includes:

plugin a, plugin b, (if  q  then  plugin c) ….

Page 20: Verifying Dependencies in Eclipse

20

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

FEATURE

feature.xml!

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !lib/jar !

plugin.xml!

MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !lib/jar!

plugin.xml!

MANIFEST.MF !

PLUGIN lib/jar !

lib/jar !lib/jar !

plugin.xml!

MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !lib/jar !

plugin.xml!

MANIFEST.MF !

PLUGIN lib/jar !

lib/jar !lib/jar !

plugin.xml!

MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

FEATURE

feature.xml!

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

lib/jar !lib/jar !

lib/jar !

plugin.xml!

MANIFEST.MF !

PLUGIN

lib/jar !lib/jar !

lib/jar !

plugin.xml!

MANIFEST.MF !

PLUGIN lib/jar !lib/jar !lib/jar !plugin.xml!MANIFEST.MF !PLUGIN

lib/jar !lib/jar !lib/jar !plugin.xml!MANIFEST.MF !PLUGIN lib/jar !lib/jar !lib/jar !plugin.xml!MANIFEST.MF !

PLUGIN

lib/jar !lib/jar !lib/jar!plugin.xml!MANIFEST.MF !PLUGIN lib/jar !lib/jar !lib/jar !plugin.xml!MANIFEST.MF !

PLUGIN

lib/jar!lib/jar !

lib/jar !

plugin.xml!

MANIFEST.MF !

PLUGIN

lib/jar !lib/jar !

lib/jar !

plugin.xml!

MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

Eclipse Feature.xml: UniqueName, Version Includes:

plugin a, plugin b, (if q then plugin c) ….

Imports: plugin p version 2.1.2 feature x ….

OSGi Plugin Manifest: UniqueName, Version Exports:

packages Imports:

libraries other plugins external packages

Host: (opt. for fragments)

Page 21: Verifying Dependencies in Eclipse

OSGi Plugin Manifest: UniqueName, Version Exports:

packages Imports:

libraries other plugins external packages

Host: (opt. for fragments)

21

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

FEATURE

feature.xml!

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !lib/jar !

plugin.xml!

MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !lib/jar!

plugin.xml!

MANIFEST.MF !

PLUGIN lib/jar !

lib/jar !lib/jar !

plugin.xml!

MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !lib/jar !

plugin.xml!

MANIFEST.MF !

PLUGIN lib/jar !

lib/jar !lib/jar !

plugin.xml!

MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

FEATURE

feature.xml!

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

lib/jar !lib/jar !

lib/jar !

plugin.xml!

MANIFEST.MF !

PLUGIN

lib/jar !lib/jar !

lib/jar !

plugin.xml!

MANIFEST.MF !

PLUGIN lib/jar !lib/jar !lib/jar !plugin.xml!MANIFEST.MF !PLUGIN

lib/jar !lib/jar !lib/jar !plugin.xml!MANIFEST.MF !PLUGIN lib/jar !lib/jar !lib/jar !plugin.xml!MANIFEST.MF !

PLUGIN

lib/jar !lib/jar !lib/jar!plugin.xml!MANIFEST.MF !PLUGIN lib/jar !lib/jar !lib/jar !plugin.xml!MANIFEST.MF !

PLUGIN

lib/jar!lib/jar !

lib/jar !

plugin.xml!

MANIFEST.MF !

PLUGIN

lib/jar !lib/jar !

lib/jar !

plugin.xml!

MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

lib/jar !

lib/jar !

lib/jar !MANIFEST.MF !

PLUGIN

Eclipse Feature.xml: UniqueName, Version Includes:

plugin a, plugin b, (if q then plugin c) ….

Imports: plugin p version 2.1.2 feature x ….

May include platform (OS, ARCH, WS, NL) conditions also

Page 22: Verifying Dependencies in Eclipse

What Did We Do?

22

Page 23: Verifying Dependencies in Eclipse

23

Specifica+on  

Spec

i$ca

tio

n /

Pro

ble

m S

pac

e Im

ple

men

tati

on/

So

luti

on

Spac

e

Page 24: Verifying Dependencies in Eclipse

24

feature.xml

feature.xml

feature.xml

feature.xml

manifest.mf

manifest.mf

manifest.mf manifest.mf

manifest.mf

manifest.mf

manifest.mf

manifest.mf

manifest.mf

Page 25: Verifying Dependencies in Eclipse

25

feature.xml manifest.mf

Speci$cation Dependency Extraction

1

Spec:  imp,exp  

Page 26: Verifying Dependencies in Eclipse

Extracting Spec. Dependencies

Problem Space

26

Page 27: Verifying Dependencies in Eclipse

27

pluginA version= 2.4.0.201305 Import-Bundle= pluginB[1.1.0,2.0.2] Import-Package= package.some 1.4.2.1234

pluginX version= 5.1.2 exports= package.some 1.4.2

pluginB version= 1.2.4.qual

pluginB version= 1.6.0

pluginB version= 1.0.0

pluginY version= 2.3.4.some exports= package.some 1.4.2.1234

pluginZ version= 2.0.0 HostBundle= pluginA 2.4.0.201305

Page 28: Verifying Dependencies in Eclipse

28

pluginA version= 2.4.0.201305 Import-Bundle= pluginB[1.1.0,2.0.2] Import-Package= package.some 1.4.2.1234

pluginX version= 5.1.2 exports= package.some 1.4.2

pluginB version= 1.2.4.qual

pluginB version= 1.6.0

pluginB version= 1.0.0

pluginY version= 2.3.4.some exports= package.some 1.4.2.1234

pluginZ version= 2.0.0 HostBundle= pluginA 2.4.0.201305

pluginA_2.4.0.201305 => (pluginB_1.2.4.qual || pluginB_1.6.0)

Page 29: Verifying Dependencies in Eclipse

29

pluginA version= 2.4.0.201305 Import-Bundle= pluginB[1.1.0,2.0.2] Import-Package= package.some 1.4.2.1234

pluginX version= 5.1.2 exports= package.some 1.4.2

pluginB version= 1.2.4.qual

pluginB version= 1.6.0

pluginB version= 1.0.0

pluginY version= 2.3.4.some exports= package.some 1.4.2.1234

pluginZ version= 2.0.0 HostBundle= pluginA 2.4.0.201305

pluginA_2.4.0.201305 => (pluginB_1.2.4.qual || pluginB_1.6.0) && pluginY_2.3.4.some

Page 30: Verifying Dependencies in Eclipse

30

pluginA version= 2.4.0.201305 Import-Bundle= pluginB[1.1.0,2.0.2] Import-Package= package.some 1.4.2.1234

pluginX version= 5.1.2 exports= package.some 1.4.2

pluginB version= 1.2.4.qual

pluginB version= 1.6.0

pluginB version= 1.0.0

pluginY version= 2.3.4.some exports= package.some 1.4.2.1234

pluginZ version= 2.0.0 HostBundle= pluginA 2.4.0.201305

pluginA_2.4.0.201305 => (pluginB_1.2.4.qual || pluginB_1.6.0) && pluginY_2.3.4.some

pluginZ_2.0.0 => pluginA_2.4.0.201305

Page 31: Verifying Dependencies in Eclipse

31

feature.xml manifest.mf

Speci$cation Dependency Extraction

1

Spec:  imp,exp  

Feature Model:

plugin_b_1.1.1.201 => plugin_a_2.4.6_qual plugin_c_4.0.3) => ( plugin_w_0.0.0 && org_eclipse_core_3.4.1 ) feature_a_1.1.1.I2011 => ( plugin_b_1.1.1.201 && plugin_c_4.0.3 && (_OS_linux => plugin_g) && feature_b_0.0.0 ) one of (_OS_linux _OS_macosx, _OS_solaris, _OS_win32 .... ) ….

Page 32: Verifying Dependencies in Eclipse

Impl:  imp,  exp  (funcSig)    &  interfaces  +  inheritances  

Interface Extraction from Plugins

2

32

Spec:  imp,exp  

feature.xml manifest.mf

Feature Model:

plugin_b_1.1.1.201 => plugin_a_2.4.6_qual plugin_c_4.0.3) => ( plugin_w_0.0.0 && org_eclipse_core_3.4.1 ) feature_a_1.1.1.I2011 => ( plugin_b_1.1.1.201 && plugin_c_4.0.3 && (_OS_linux => plugin_g) && feature_b_0.0.0 ) one of (_OS_linux _OS_macosx, _OS_solaris, _OS_win32 .... ) ….

Speci$cation Dependency Extraction

1

Page 33: Verifying Dependencies in Eclipse

Extracting Impl. Dependencies

Solution Space

33

Page 34: Verifying Dependencies in Eclipse

34

package org.some;!public class A {! public void fn() {....}! public String foo(int a) {....}! private int process() {! B b = new B(); boolean flag = B.go();! C c=new C(); c.callfn(“hello”);! }!}!-------------------------------------------!package org.someother;!public class C {! void callfn(String x) {....}!}!

package com.eother.some;!public class B extends G {! public boolean go() {! return true;! }!}!----------------------------------!package com.eother;!public class G {!....!}!!!!

pluginX pluginY

Page 35: Verifying Dependencies in Eclipse

35

package org.some;!public class A {! public void fn() {....}! public String foo(int a) {....}! private int process() {! B b = new B(); boolean flag = B.go();! C c=new C(); c.callfn(“hello”);! }!}!-------------------------------------------!package org.someother;!public Class C {! void callfn(String x) {....}!}!

package com.eother.some;!public class B extends G {! public boolean go() {! return true;! }!}!----------------------------------!package com.eother;!public class G {!....!}!!!!

pluginX pluginY

Imports: boolean com.eother.some.B.go () void org.someother.C.callfn (java.lang.String)

Exports: void org.some.A.fn () java.lang.String org.some.A.foo (int)

Page 36: Verifying Dependencies in Eclipse

36

package org.some;!public class A {! public void fn() {....}! public String foo(int a) {....}! private int process() {! B b = new B(); boolean flag = B.go();! C c=new C(); c.callfn(“hello”);! }!}!-------------------------------------------!package org.someother;!public Class C {! void callfn(String x) {....}!}!

package com.eother.some;!public class B extends G {! public boolean go() {! return true;! }!}!----------------------------------!package com.eother;!public class G {!....!}!!!!

pluginX pluginY

Imports: boolean com.eother.some.B.go () void org.someother.C.callfn (java.lang.String)

Exports: void org.some.A.fn () java.lang.String org.some.A.foo (int) void org.someother.C.callfn (java.lang.String)

Page 37: Verifying Dependencies in Eclipse

37

package org.some;!public class A {! public void fn() {....}! public String foo(int a) {....}! private int process() {! B b = new B(); boolean flag = B.go();! C c=new C(); c.callfn(“hello”);! }!}!-------------------------------------------!package org.someother;!public Class C {! void callfn(String x) {....}!}!

package com.eother.some;!public class B extends G {! public boolean go() {! return true;! }!}!----------------------------------!package com.eother;!public class G {!....!}!!!!

pluginX pluginY

Imports: boolean com.eother.some.B.go () void org.someother.C.callfn (java.lang.String)

Exports: void org.some.A.fn () java.lang.String org.some.A.foo (int) void org.someother.C.callfn (java.lang.String)

Page 38: Verifying Dependencies in Eclipse

38

package org.some;!public class A {! public void fn() {....}! public String foo(int a) {....}! private int process() {! B b = new B(); boolean flag = B.go();! C c=new C(); c.callfn(“hello”);! }!}!-------------------------------------------!package org.someother;!public Class C {! void callfn(String x) {....}!}!

package com.eother.some;!public class B extends G {! public boolean go() {! return true;! }!}!----------------------------------!package com.eother;!public class G {!....!}!!!!

pluginX pluginY

Imports: boolean com.eother.some.B.go () void org.someother.C.callfn (java.lang.String)

Exports: void org.some.A.fn () java.lang.String org.some.A.foo (int) void org.someother.C.callfn (java.lang.String)

Imports:

Exports: boolean com.eother.some.B.go()

Page 39: Verifying Dependencies in Eclipse

39

package org.some;!public class A {! public void fn() {....}! public String foo(int a) {....}! private int process() {! B b = new B(); boolean flag = B.go();! C c=new C(); c.callfn(“hello”);! }!}!-------------------------------------------!package org.someother;!public Class C {! void callfn(String x) {....}!}!

package com.eother.some;!public class B extends G {! public boolean go() {! return true;! }!}!----------------------------------!package com.eother;!public class G {!....!}!!!!

pluginX pluginY

Imports: boolean com.eother.some.B.go () void org.someother.C.callfn (java.lang.String)

Exports: void org.some.A.fn () java.lang.String org.some.A.foo (int) void org.someother.C.callfn (java.lang.String)

Imports:

Exports: boolean com.eother.some.B.go()

Inheritance: com.eother.some.B com.eother.G

Page 40: Verifying Dependencies in Eclipse

Why bytecode?

•  fully quali$ed names, signatures and access opcodes •  no need to to do all sorts of resolution

–  (parsing and extraction is simpler)

•  that is what we have available from plugin dist anyway

ASM all purpose Java bytecode manipulation and analysis framework

several interfaces provided: ClassVisitor, MethodVisitor

http://asm.ow2.org/

40

Parsing Bytecode

Page 41: Verifying Dependencies in Eclipse

Linking & Inter-Plugin Dependency Analysis

3

41

Interface Extraction from Plugins

2

Impl:  imp,  exp  (funcSig)    &  interfaces  +  inheritances  

Spec:  imp,exp  

feature.xml manifest.mf

Feature Model:

plugin_b_1.1.1.201 => plugin_a_2.4.6_qual plugin_c_4.0.3) => ( plugin_w_0.0.0 && org_eclipse_core_3.4.1 ) feature_a_1.1.1.I2011 => ( plugin_b_1.1.1.201 && plugin_c_4.0.3 && (_OS_linux => plugin_g) && feature_b_0.0.0 ) one of (_OS_linux _OS_macosx, _OS_solaris, _OS_win32 .... ) ….

Speci$cation Dependency Extraction

1

Page 42: Verifying Dependencies in Eclipse

42

B class/interface  

import A .... void ba { A.go (); } ....

pluginW

package org.some;!public class A {! public void fn() {....}! public String foo(int a) {....}! private int process() {! B b = new B(); ! boolean flag = B.go();! C c=new C(); c.callfn(“hello”);! }}!package org.someother;!public Class C {! void callfn(String x) {....}!}!

package com.eother.some;!public class B extends G {! public boolean go() {! return true;! }!}!!package com.eother;!public class G {!....!}!!!

pluginX pluginY

Imports: boolean com.eother.some.B.go () void org.someother.C.callfn (java.lang.String) Exports: void org.some.A.fn () java.lang.String org.some.A.foo (int) void org.someother.C.callfn (java.lang.String)

Imports:

Exports: boolean com.eother.some.B.go()

Inheritance: com.eother.some.B com.eother.G A B

void A.go ()

Linking & Inter-Plugin Dependency Analysis

3

Page 43: Verifying Dependencies in Eclipse

B T

pluginY

43

B class/interface  

import A .... void ba { A.go (); } ....

pluginW

A B

void A.go ()

Linking & Inter-Plugin Dependency Analysis

3

Page 44: Verifying Dependencies in Eclipse

B T

pluginY

44

B class/interface  

K { void go() {} }

pluginZ

C

pluginP

G

S

import A .... void ba { A.go (); } ....

pluginW

void K.go() [pluginY, pluginP, pluginZ]

A B

void A.go ()

Linking & Inter-Plugin Dependency Analysis

3

Page 45: Verifying Dependencies in Eclipse

B T

pluginY

45

B class/interface  

K { void go() {} }

pluginZ

C

pluginP

G

S

import A .... void ba { A.go (); } ....

pluginW

Constraint: pluginW => ( pluginY && pluginP && pluginZ )

void K.go() [pluginY, pluginP, pluginZ]

A B

void A.go ()

Linking & Inter-Plugin Dependency Analysis

3

Page 46: Verifying Dependencies in Eclipse

46

com.zink.fly.buzz_1.2.1.201104282140 => (org.eclipse.jface_3.8.102.v20130123.162658 && org.eclipse.ui.workbench_3.104.0.v20130204.164612 && com.zink.fly.buzz_1.2.1.201104282140) || (org.eclipse.jface_3.8.102.v20130123.162658 && com.zink.fly.buzz_1.2.1.201104282140)

com.zink.fly.buzz_1.2.1.201104282140 => org.eclipse.jface_3.8.102.v20130123.162658 com.zink.fly.buzz_1.2.1.201104282140 => org.eclipse.swt.cocoa.macosx.x86.64_3.100.1.v4236b com.zink.fly.buzz_1.2.1.201104282140 => (org.eclipse.ui.workbench_3.104.0.v20130204.164612 &&

com.zink.fly.buzz_1.2.1.201104282140) com.zink.fly.buzz_1.2.1.201104282140 => org.eclipse.ui.workbench_3.104.0.v20130204.164612 javax.wsdl_1.6.2.v201012040545 => JAVA.CLASSES.SDK || javax.xml_1.3.4.v201005080400 javax.wsdl_1.6.2.v201012040545 => JAVA.CLASSES.SDK || javax.xml_1.3.4.v201005080400 ||

(javax.xml_1.3.4.v201005080400 && JAVA.CLASSES.SDK) javax.xml.bind_2.1.9.v201005080401 => JAVA.CLASSES.SDK || javax.xml_1.3.4.v201005080400 org.apache.ant_1.8.3.v201301120609 => (JAVA.CLASSES.SDK && com.jcraft.jsch_0.1.46.v201205102330) org.apache.ant_1.8.3.v201301120609 => (JAVA.CLASSES.SDK && org.apache.ant_1.8.3.v201301120609) org.apache.ant_1.8.3.v201301120609 => (JAVA.CLASSES.SDK && org.junit_3.8.2.v3.8.2.v20100427.1100) ||

(JAVA.CLASSES.SDK && org.junit_4.10.0.v4.10.0.v20120426.0900) org.apache.ant_1.8.3.v201301120609 => (JAVA.CLASSES.SDK &&

org.python.pydev.shared.interactive.console_2.7.3.2013031601) || (JAVA.CLASSES.SDK && org.apache.commons.logging_1.0.4.v201101211617)

org.apache.ant_1.8.3.v201301120609 => JAVA.CLASSES.SDK || javax.xml_1.3.4.v201005080400 org.apache.ant_1.8.3.v201301120609 => JAVA.CLASSES.SDK || javax.xml_1.3.4.v201005080400 ||

(javax.xml_1.3.4.v201005080400 && JAVA.CLASSES.SDK) org.apache.ant_1.8.3.v201301120609 => com.jcraft.jsch_0.1.46.v201205102330 org.apache.ant_1.8.3.v201301120609 => org.apache.log4j_1.2.15.v201012070815

Linking & Inter-Plugin Dependency Analysis

3Constraints

Set

Page 47: Verifying Dependencies in Eclipse

47

Constraints:

(plugin_b_1.1.1.201 || plugin_c_4.0.3) => ( plugin_a_1.2.4 && plugin_w_1.1.5.u7256 ) ….

Import (invokation)

Satisfaction Report

Linking & Inter-Plugin Dependency Analysis

3

Interface Extraction from Plugins

2

Impl:  imp,  exp  (funcSig)    &  interfaces  +  inheritances  

Spec:  imp,exp  

feature.xml manifest.mf

Feature Model:

plugin_b_1.1.1.201 => plugin_a_2.4.6_qual plugin_c_4.0.3) => ( plugin_w_0.0.0 && org_eclipse_core_3.4.1 ) feature_a_1.1.1.I2011 => ( plugin_b_1.1.1.201 && plugin_c_4.0.3 && (_OS_linux => plugin_g) && feature_b_0.0.0 ) one of (_OS_linux _OS_macosx, _OS_solaris, _OS_win32 .... ) ….

Speci$cation Dependency Extraction

1

Page 48: Verifying Dependencies in Eclipse

48

Constraints:

(plugin_b_1.1.1.201 || plugin_c_4.0.3) => ( plugin_a_1.2.4 && plugin_w_1.1.5.u7256 ) ….

Import (invokation)

Satisfaction Report

Linking & Inter-Plugin Dependency Analysis

3

Interface Extraction from Plugins

2

Impl:  imp,  exp  (funcSig)    &  interfaces  +  inheritances  

Spec:  imp,exp  

feature.xml manifest.mf

Feature Model:

plugin_b_1.1.1.201 => plugin_a_2.4.6_qual plugin_c_4.0.3) => ( plugin_w_0.0.0 && org_eclipse_core_3.4.1 ) feature_a_1.1.1.I2011 => ( plugin_b_1.1.1.201 && plugin_c_4.0.3 && (_OS_linux => plugin_g) && feature_b_0.0.0 ) one of (_OS_linux _OS_macosx, _OS_solaris, _OS_win32 .... ) ….

Speci$cation Dependency Extraction

1

Consistency Report

Consistency Check

4

Page 49: Verifying Dependencies in Eclipse

49

Page 50: Verifying Dependencies in Eclipse

Preliminary Results

50  

Page 51: Verifying Dependencies in Eclipse

51  

Plugins 766

Features 86

Imports 197188 (external & non-java & non-optional )

Feature Model entries 4237

Constraints entries 9756

Time ~ 3 min

A typical eclipse installation

Page 52: Verifying Dependencies in Eclipse

52  

void org.apache.xmlbeans.XmlCursor.push () Importing Plugins org.mozilla.javascript 1.7.2.v201005080400 Exporting Plugins --

boolean org.apache.xmlbeans.XmlCursor$TokenType.isAnyAttr () boolean org.apache.xmlbeans.XmlCursor$TokenType.isAttr () boolean org.apache.xmlbeans.XmlCursor$TokenType.isComment () org.apache.xmlbeans.XmlObject org.apache.xmlbeans.XmlObject$Factory.newInstance () org.apache.xmlbeans.XmlObject org.apache.xmlbeans.XmlObject$Factory.parse (java.lang.String,) void org.apache.xmlbeans.XmlCursor.dispose () .... ....

Plugin: org.mozilla.javascript version= 1.7.2.v201005080400 Spec. missing package import: org.apache.xmlbeans

Page 53: Verifying Dependencies in Eclipse

53

void org.eclipse.jdt.internal.corext.dom. Modi$erRewrite.setVisibility (….) Importers com.stateo%ow.eclipse.tane 1.3.1.201104282140 Exporters --

Plugin: com.stateo"ow.eclipse.tane version= 1.3.1.201104282140 Spec: import-package: org.eclipse.idt.internal.corext Still, the function: void org.eclipse.jdt.internal.corext.dom. Modi$erRewrite.setVisibility (….)

does not exist!

Exists: org.eclipse.jdt.internal.corext.$x.LinkedProposalPositionGroup$PositionInformation org.eclipse.jdt.internal.corext.dom.Modi$erRewrite.setVisibility (….) instead of: void org.eclipse.jdt.internal.corext.dom.Modi$erRewrite.setVisibility (….)

A case of API evolution ?

Page 54: Verifying Dependencies in Eclipse

54  

Page 55: Verifying Dependencies in Eclipse

55  

Page 56: Verifying Dependencies in Eclipse

56  

OSGi

Page 57: Verifying Dependencies in Eclipse

57  

OSGi

Page 58: Verifying Dependencies in Eclipse

58  OSGi

OSGi

OSGi

Eclipse+OSGi

Page 59: Verifying Dependencies in Eclipse

59  But we need a whole new animal, you see ....

Page 60: Verifying Dependencies in Eclipse

60  

…. it still works! But we need to be better ….

Page 61: Verifying Dependencies in Eclipse

Future Work

61  

Page 62: Verifying Dependencies in Eclipse

62  

Continue analysis of plugin compatibility across (user-speci$ed) version ranges

Discussion on the design of a module system based on observations from eclipse

Study API Usage evolution in Java and in an ecosystem like Eclipse (Based on historical data from plugins on deprecated api and evolution)

Page 63: Verifying Dependencies in Eclipse

63  

Solution Space

Problem Space

Constraints Feature Model

Import (invokation)

Satisfaction Report

ConsistencyReport

Analysis of user-speci$ed dependencies over version ranges Module system design based on observations from eclipse Deprecation, api and its usage evolution  

Consistency Check

K { void fn() {} }

A B C G

B

S

import A .... void ba {A.fn();} ....

org.mozilla.javascript Spec. missing package import

The function: void ….Modi$erRewrite .setVisibility (….) does not exist!

http://shivanshukumar.github.io/PluginAnalyser/

4

4

4

34

2

4

1