How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

59
How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem Romain Robbes David Röthlisberger University of Chile Mircea Lungu Software Composition Group University of Bern FSE, 2012

Transcript of How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

Page 1: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

How Do Developers React to

API Deprecation? The Case of a Smalltalk Ecosystem

Romain RobbesDavid Röthlisberger

University of Chile

Mircea LunguSoftware Composition GroupUniversity of Bern

FSE, 2012

Page 2: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

SoftwareEcosystemsA Natural Ecosystem

Page 3: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

A Software Ecosystem

A collection of software systems which are developed and co-evolve in the same environment.

Page 4: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

Dependency

size

Activity (high)

Activity (low)A Software Ecosystem

A collection of software systems which are developed and co-evolve in the same environment.

Page 5: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

A Software EcosystemA Software Ecosystem

A collection of software systems which are developed and co-evolve in the same environment.

Page 6: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

[...] where is MOLabelShape, why was it deleted?? I use it and now is gone!!! I even had a specialization of it [...]

Page 7: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

FillInTheBlank(deprecated)

UIManager(recommended)

Deprecating a class in the ecosystem

Page 8: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

Tool Support...

Page 9: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

Tool Support...

Empirical Evidence

First!

Page 10: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

API Changes

Classes

Methods

Providers

Page 11: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

API Changes

Ripple-inducing changes

• addition of provider

• change of provider

• removal of provider

Classes

Methods

Providers

Page 12: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

API Changes

Ripple-inducing changes

• addition of provider

• change of provider

• removal of provider

Classes

Methods

Providers

Deprecation of provider = lower bounds

Page 13: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

API Deprecation:Empirical Study

1. Frequency2. Magnitude3. Duration4. Adaptation

Page 14: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

Contributors:Projects:Classes:

Commits:LOC:

SqueakSource{ 2.3002.500

95.000110.000

600.000.0008 years

Page 15: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

How to model the history of SqueakSource?

Added

Removed

RequiredProvided

...

Vers

ion

1

Vers

ion

2

Vers

ion

i

Vers

ion

n

...

SystemVersion

Ecosystem History

History

...

System History

...Artifacts

History

History

Page 16: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

Ecco - a lighweight model

Added

Removed

RequiredProvided

...

Vers

ion

1

Vers

ion

2

Vers

ion

i

Vers

ion

n

...

SystemVersion

Ecosystem History

History

...

System History

...Artifacts

History

History

Page 17: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

Methodology

1. Generate list of candidates (577 methods, 186 classes)

2. Filter methods removed less than 3 times

3. Manual inspection of the rest of the candidates

4. Answer RQ for all the true deprecation-based ripples

Page 18: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

Manual Inspection

+Retrieve changes involving deprecation

+Display changes in Ripple Browser

+Validate impacted projects

+Track replacement methods

= 180 methods + 20 classes

x2

Page 19: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

Results

Page 20: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

Results}Frequency

Magnitude

Duration

Adaptations

Page 21: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ1: Frequency of ripple effects triggered by API deprecation

14% of deprecated methods triggered ripple effects.

7% of deprecated classes triggered ripple effects.

Page 22: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ1: Frequency of ripple effects triggered by API deprecation

14% of deprecated methods triggered ripple effects.

7% of deprecated classes triggered ripple effects.

⤷developers do not know their clients and program defensively

Page 23: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ1: Frequency of ripple effects triggered by API deprecation

14% of deprecated methods triggered ripple effects.

7% of deprecated classes triggered ripple effects.

⤷developers do not know their clients and program defensively

clients may still be unaware of deprecations⤷

Page 24: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ2: Magnitude of ripple effects triggered by API deprecation

reacting projects●

020

40

60

80

(i) reacting projects

●●

020

40

60

80

100

120

(ii) reacting packages

Page 25: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ2: Magnitude of ripple effects triggered by API deprecation

reacting projects●

020

40

60

80

(i) reacting projects

●●

020

40

60

80

100

120

(ii) reacting packages

⤷ the impact on the ecosystem can be very large

⤷ several projects usually react

Page 26: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

Viewing the magnitude from other angles

Projects Packages CommitsDevelopers0

20

40

60

A project reacting to an API change ...

Page 27: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

Viewing the magnitude from other angles

Projects Packages CommitsDevelopers

⤷may involve several developers and packages

0

20

40

60

A project reacting to an API change ...

Page 28: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

Viewing the magnitude from other angles

Projects Packages CommitsDevelopers

⤷may involve several developers and packages

0

20

40

60

⤷ is often a process involving several commits

A project reacting to an API change ...

Page 29: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ3: Duration of ripple effects triggered by API deprecation

Adaptation time (in days)

●●

0200

400

600

800

(i) reaction Time

010

20

30

40

50

60

(ii) adaptation time

For a given project, the adaptation time is the time between the first reaction and the last reaction to the API change

Page 30: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ3: Duration of ripple effects triggered by API deprecation

Adaptation time (in days)

⤷ most projects are quick to react and adapt;but not all are

●●

0200

400

600

800

(i) reaction Time

010

20

30

40

50

60

(ii) adaptation time

For a given project, the adaptation time is the time between the first reaction and the last reaction to the API change

Page 31: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ3: Duration of ripple effects triggered by API deprecation

Adaptation time (in days)

⤷ most projects are quick to react and adapt;but not all are

●●

0200

400

600

800

(i) reaction Time

010

20

30

40

50

60

(ii) adaptation time

For a given project, the adaptation time is the time between the first reaction and the last reaction to the API change

⤷ On the scale of the ecosystem, some ripple effects lasted for years.

Page 32: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ4: Do all projects adapt to API changes?

All Activeprojects

No counter-reactions

0

18

35

53

70

20%

40%

66%

Page 33: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ4: Do all projects adapt to API changes?

All Activeprojects

No counter-reactions

0

18

35

53

70

20%

40%

66%

Why so fewreacting projects?

Page 34: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ4: Do all projects adapt to API changes?

All Activeprojects

No counter-reactions

0

18

35

53

70

20%

40%

66%

Dead or stagnant projects?

Why so fewreacting projects?

Page 35: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ4: Do all projects adapt to API changes?

All Activeprojects

No counter-reactions

0

18

35

53

70

20%

40%

66%

Why so fewreacting projects?

Page 36: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ4: Do all projects adapt to API changes?

All Activeprojects

No counter-reactions

0

18

35

53

70

20%

40%

66%

Why so fewreacting projects?

Forks in theecosystem?

Page 37: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ4: Do all projects adapt to API changes?

All Activeprojects

No counter-reactions

0

18

35

53

70

20%

40%

66%

Why so fewreacting projects?

Page 38: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ4: Do all projects adapt to API changes?

All Activeprojects

No counter-reactions

0

18

35

53

70

20%

40%

66%

Page 39: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ4: Do all projects adapt to API changes?

All Activeprojects

⤷ common reasons for not reacting are stagnancy,forks, but also freezed dependencies and unawareness.

No counter-reactions

0

18

35

53

70

20%

40%

66%

Page 40: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ5: Consistency of adaptations

addEntity: was replaced by:

add:

addModel:

addObject:

addAll:

addSibling:

0 20 40 60 80

Page 41: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ5: Consistency of adaptations

020

40

60

80

100

Probability of most likely replacement

Frequency of most frequent replacementaddEntity: was replaced by:

add:

addModel:

addObject:

addAll:

addSibling:

0 20 40 60 80

Page 42: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ5: Consistency of adaptations

⤷ Many API deprecation have similar reactions

020

40

60

80

100

Probability of most likely replacement

Frequency of most frequent replacementaddEntity: was replaced by:

add:

addModel:

addObject:

addAll:

addSibling:

0 20 40 60 80

Page 43: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ5: Consistency of adaptations

⤷ Many API deprecation have similar reactions

020

40

60

80

100

Probability of most likely replacement

Frequency of most frequent replacementaddEntity: was replaced by:

add:

addModel:

addObject:

addAll:

addSibling:

0 20 40 60 80

16% of deprecations had a systematic replacement⤷

Page 44: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ6: Were deprecation messages useful?

foo: x self deprecated: ‘use method bar instead’

Page 45: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ6: Were deprecation messages useful?

We categorized deprecation messages according to whether developer followed the recommendation.

foo: x self deprecated: ‘use method bar instead’

Page 46: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ6: Were deprecation messages useful?

We categorized deprecation messages according to whether developer followed the recommendation.

Mostly followed: if “X” most people did X

Somewhat followed: most people did Y, but others did X

Not followed: most people did Y, Z ...

Missing: no recommendation, vague recommendation.

foo: x self deprecated: ‘use method bar instead’

Page 47: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ6: Were deprecation messages useful?

We categorized deprecation messages according to whether developer followed the recommendation.

Mostly followed: if “X” most people did X

Somewhat followed: most people did Y, but others did X

Not followed: most people did Y, Z ...

Missing: no recommendation, vague recommendation.

foo: x self deprecated: ‘use method bar instead’

self deprecated: ‘removed functionality’self deprecated: ‘use canvas API’self deprecated: ‘ugly method, do not call it!’

Page 48: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ6: Were deprecation messages useful?

Mostlyfollowed

Somewhatfollowed

Missing

0

13

25

38

50 46.8%

7.4%

40.4%

Notfollowed

5.3%

Recommendation ...

Page 49: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

RQ6: Were deprecation messages useful?

⤷ half of deprecation messages are missing or not useful

Mostlyfollowed

Somewhatfollowed

Missing

0

13

25

38

50 46.8%

7.4%

40.4%

Notfollowed

5.3%

Recommendation ...

Page 50: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

Threats to validity

Code duplication, name clashes introduce noise

We only consider explicit deprecation so far

Partially manual analysis

Single case study with peculiarities:– Dynamically typed language (Smalltalk)– Fork in the community

Page 51: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

Related work

Empirical studies:– Studies of API changes and client evolution [Dig & Johnson, 2005]– Studies of ripple effects at the system level [Yau et al., 1978; Black, 2001]

Adapting to API changes:– Replaying refactorings [Henkel & Diwan 2004; Ekman & Asklund 2005; Dig et al. 2007]– Detecting systematic changes [Kim and Notkin 2009]– Adapting to evolving frameworks [Dagenais & Robillard 2008; Shäfer et al. 2008]– Filtering irrelevant changes [Holmes and Walker, 2010]

Page 52: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

Conclusions and implications

Added

Removed

RequiredProvided

...

Vers

ion

1

Vers

ion

2

Vers

ion

i

Vers

ion

n

...

SystemVersion

Ecosystem History

History

...

System History

...Artifacts

History

History

Page 53: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

Conclusions and implications

⤷ The quality of deprecation guidelines should be improved

Added

Removed

RequiredProvided

...

Vers

ion

1

Vers

ion

2

Vers

ion

i

Vers

ion

n

...

SystemVersion

Ecosystem History

History

...

System History

...Artifacts

History

History

Page 54: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

Conclusions and implications

⤷ The quality of deprecation guidelines should be improved

⤷ Some API deprecations have a large impact

Added

Removed

RequiredProvided

...

Vers

ion

1

Vers

ion

2

Vers

ion

i

Vers

ion

n

...

SystemVersion

Ecosystem History

History

...

System History

...Artifacts

History

History

Page 55: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

Conclusions and implications

⤷ The quality of deprecation guidelines should be improved

⤷ Some API deprecations have a large impact

⤷ Developers do not know how their software is used

Added

Removed

RequiredProvided

...

Vers

ion

1

Vers

ion

2

Vers

ion

i

Vers

ion

n

...

SystemVersion

Ecosystem History

History

...

System History

...Artifacts

History

History

Page 56: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

Conclusions and implications

⤷ The quality of deprecation guidelines should be improved

⤷ Some API deprecations have a large impact

⤷ Developers do not know how their software is used

⤷ Reactions to API changes can be partially automated

Added

Removed

RequiredProvided

...

Vers

ion

1

Vers

ion

2

Vers

ion

i

Vers

ion

n

...

SystemVersion

Ecosystem History

History

...

System History

...Artifacts

History

History

Page 57: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

Conclusions and implications

⤷ The quality of deprecation guidelines should be improved

⤷ Some API deprecations have a large impact

⤷ Developers do not know how their software is used

⤷ Reactions to API changes can be partially automated

⤷ Tool support is needed to help with API changes

Added

Removed

RequiredProvided

...

Vers

ion

1

Vers

ion

2

Vers

ion

i

Vers

ion

n

...

SystemVersion

Ecosystem History

History

...

System History

...Artifacts

History

History

Page 58: How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem

Conclusions and implications

⤷ The quality of deprecation guidelines should be improved

⤷ Some API deprecations have a large impact

⤷ Developers do not know how their software is used

⤷ Reactions to API changes can be partially automated

⤷ Tool support is needed to help with API changes

Added

Removed

RequiredProvided

...

Vers

ion

1

Vers

ion

2

Vers

ion

i

Vers

ion

n

...

SystemVersion

Ecosystem History

History

...

System History

...Artifacts

History

History