Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How Do Developers React to API Deprecation?

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for Mircea Lungu Mircea Lungu
November 15, 2012

How Do Developers React to API Deprecation?

These are the slides of our presentation at FSE 2012.

Avatar for Mircea Lungu

Mircea Lungu

November 15, 2012
Tweet

More Decks by Mircea Lungu

Other Decks in Education

Transcript

  1. 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
  2. A Software Ecosystem A collection of software systems which are

    developed and co-evolve in the same environment.
  3. Dependency size Activity (high) Activity (low) A Software Ecosystem A

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

    systems which are developed and co-evolve in the same environment.
  5. [...] where is MOLabelShape, why was it deleted?? I use

    it and now is gone!!! I even had a specialization of it [...]
  6. API Changes Ripple-inducing changes • addition of provider • change

    of provider • removal of provider Classes Methods Providers
  7. API Changes Ripple-inducing changes • addition of provider • change

    of provider • removal of provider Classes Methods Providers Deprecation of provider = lower bounds
  8. How to model the history of SqueakSource? Added Removed Required

    Provided ... Version 1 Version 2 Version i Version n ... System Version Ecosystem History History ... System History ... Artifacts History History
  9. Ecco - a lighweight model Added Removed Required Provided ...

    Version 1 Version 2 Version i Version n ... System Version Ecosystem History History ... System History ... Artifacts History History
  10. 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
  11. Manual Inspection +Retrieve changes involving deprecation +Display changes in Ripple

    Browser +Validate impacted projects +Track replacement methods = 180 methods + 20 classes x2
  12. RQ1: Frequency of ripple effects triggered by API deprecation 14%

    of deprecated methods triggered ripple effects. 7% of deprecated classes triggered ripple effects.
  13. 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
  14. 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 ⤷
  15. RQ2: Magnitude of ripple effects triggered by API deprecation reacting

    projects • • • • • • • • • 0 20 40 60 80 (i) reacting projects • • • • • • • • • • • 0 20 40 60 80 100 120 (ii) reacting pack
  16. RQ2: Magnitude of ripple effects triggered by API deprecation reacting

    projects • • • • • • • • • 0 20 40 60 80 (i) reacting projects • • • • • • • • • • • 0 20 40 60 80 100 120 (ii) reacting pack ⤷the impact on the ecosystem can be very large ⤷several projects usually react
  17. Viewing the magnitude from other angles Projects Packages Commits Developers

    0 20 40 60 A project reacting to an API change ...
  18. Viewing the magnitude from other angles Projects Packages Commits Developers

    ⤷may involve several developers and packages 0 20 40 60 A project reacting to an API change ...
  19. Viewing the magnitude from other angles Projects Packages Commits Developers

    ⤷may involve several developers and packages 0 20 40 60 ⤷is often a process involving several commits A project reacting to an API change ...
  20. RQ3: Duration of ripple effects triggered by API deprecation Adaptation

    time (in days) • • • • • • • • • • 0 200 400 600 800 (i) reaction Time 0 10 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
  21. 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 • • • • • • • • • • 0 200 400 600 800 (i) reaction Time 0 10 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
  22. 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 • • • • • • • • • • 0 200 400 600 800 (i) reaction Time 0 10 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.
  23. RQ4: Do all projects adapt to API changes? All Active

    projects No counter- reactions 0 18 35 53 70 20% 40% 66%
  24. RQ4: Do all projects adapt to API changes? All Active

    projects No counter- reactions 0 18 35 53 70 20% 40% 66% Why so few reacting projects?
  25. RQ4: Do all projects adapt to API changes? All Active

    projects No counter- reactions 0 18 35 53 70 20% 40% 66% Dead or stagnant projects? Why so few reacting projects?
  26. RQ4: Do all projects adapt to API changes? All Active

    projects No counter- reactions 0 18 35 53 70 20% 40% 66% Why so few reacting projects?
  27. RQ4: Do all projects adapt to API changes? All Active

    projects No counter- reactions 0 18 35 53 70 20% 40% 66% Why so few reacting projects? Forks in the ecosystem?
  28. RQ4: Do all projects adapt to API changes? All Active

    projects No counter- reactions 0 18 35 53 70 20% 40% 66% Why so few reacting projects?
  29. RQ4: Do all projects adapt to API changes? All Active

    projects No counter- reactions 0 18 35 53 70 20% 40% 66%
  30. RQ4: Do all projects adapt to API changes? All Active

    projects ⤷ 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%
  31. RQ5: Consistency of adaptations 0 20 40 60 80 100

    Probability of most likely replacement Frequency of most frequent replacement addEntity: was replaced by: add: addModel: addObject: addAll: addSibling: 0 20 40 60 80
  32. RQ5: Consistency of adaptations ⤷ Many API deprecation have similar

    reactions 0 20 40 60 80 100 Probability of most likely replacement Frequency of most frequent replacement addEntity: was replaced by: add: addModel: addObject: addAll: addSibling: 0 20 40 60 80
  33. RQ5: Consistency of adaptations ⤷ Many API deprecation have similar

    reactions 0 20 40 60 80 100 Probability of most likely replacement Frequency of most frequent replacement addEntity: was replaced by: add: addModel: addObject: addAll: addSibling: 0 20 40 60 80 16% of deprecations had a systematic replacement ⤷
  34. RQ6: Were deprecation messages useful? We categorized deprecation messages according

    to whether developer followed the recommendation. foo: x self deprecated: ‘use method bar instead’
  35. 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’
  36. 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!’
  37. RQ6: Were deprecation messages useful? Mostly followed Somewhat followed Missing

    0 13 25 38 50 46.8% 7.4% 40.4% Not followed 5.3% Recommendation ...
  38. RQ6: Were deprecation messages useful? ⤷ half of deprecation messages

    are missing or not useful Mostly followed Somewhat followed Missing 0 13 25 38 50 46.8% 7.4% 40.4% Not followed 5.3% Recommendation ...
  39. 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
  40. 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]
  41. Conclusions and implications Added Removed Required Provided ... Version 1

    Version 2 Version i Version n ... System Version Ecosystem History History ... System History ... Artifacts History History
  42. Conclusions and implications ⤷ The quality of deprecation guidelines should

    be improved Added Removed Required Provided ... Version 1 Version 2 Version i Version n ... System Version Ecosystem History History ... System History ... Artifacts History History
  43. Conclusions and implications ⤷ The quality of deprecation guidelines should

    be improved ⤷ Some API deprecations have a large impact Added Removed Required Provided ... Version 1 Version 2 Version i Version n ... System Version Ecosystem History History ... System History ... Artifacts History History
  44. 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 Required Provided ... Version 1 Version 2 Version i Version n ... System Version Ecosystem History History ... System History ... Artifacts History History
  45. 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 Required Provided ... Version 1 Version 2 Version i Version n ... System Version Ecosystem History History ... System History ... Artifacts History History
  46. 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 Required Provided ... Version 1 Version 2 Version i Version n ... System Version Ecosystem History History ... System History ... Artifacts History History
  47. 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 Required Provided ... Version 1 Version 2 Version i Version n ... System Version Ecosystem History History ... System History ... Artifacts History History