Why Do We Break APIs? First Answers from Developers (SANER ERA 2017)

Why Do We Break APIs? First Answers from Developers (SANER ERA 2017)

Breaking contracts have a major impact on API clients. Despite this fact, recent studies show that libraries are often backward incompatible and that the rate of breaking changes increase over time. However, the specific reasons that motivate library developers to break contracts with their clients are still unclear. In this paper, we describe a qualitative study with library developers and real instance of API breaking changes. Our goal is to (i) elicit the reasons why developers introduce breaking changes; and (ii) check if they are aware about the risks of such changes. Our survey with the top contributors of popular Java libraries contributes to reveal a list of five reasons why developers break API contracts. Moreover, it also shows that most of developers are aware of these risks and, in some cases, adopt strategies to mitigate them. We conclude by prospecting a future study to strengthen our current findings. With this study, we expect to contribute on delineating tools to better assess the risks and impacts of API breaking changes.

13beaa3b7239eca3319d54c6a9f3a85a?s=128

ASERG, DCC, UFMG

February 22, 2017
Tweet

Transcript

  1. Why Do We Break APIs? First Answers from Developers Laerte

    Xavier, André Hora, Marco Tulio Valente Federal University of Minas Gerais, Brazil SANER 2017 ERA Track
  2. 2 Breaking API contracts is a common practice!

  3. API changes break compatiblity 28% Historical and Impact Analysis of

    API Breaking Changes: A Large-Scale Study, SANER, 2017 3
  4. 4 The rate of breaking changes increases over time! Historical

    and Impact Analysis of API Breaking Changes: A Large-Scale Study, SANER, 2017
  5. 5 What specific reasons motivate API breaking changes?

  6. 6 RQ1: Why do developers break API contracts? RQ2: Are

    developers aware of the impact of breaking changes on client applications? Research Questions
  7. 7 TOP-317 GITHUB JAVA LIBRARIES

  8. 8 TOP-317 GITHUB JAVA LIBRARIES 90 LIBRARIES WITH MORE THAN

    50 BREAKING CHANGES
  9. 9 TOP-317 90 49 EMAILS FROM MAJOR CONTRIBUTORS GITHUB JAVA

    LIBRARIES LIBRARIES WITH MORE THAN 50 BREAKING CHANGES
  10. 49 EMAILS SENT 10

  11. 49 EMAILS SENT 14 ANSWERS RECEIVED 11

  12. 49 EMAILS SENT 14 ANSWERS RECEIVED 28% RESPONSE RATE 12

  13. 13 49 EMAILS SENT 14 ANSWERS RECEIVED 7 EMAILS SELECTED

    RESPONSE RATE 28%
  14. 14

  15. 15

  16. 16

  17. 17

  18. 18

  19. 19 RQ1: Why do developers break API contracts? RQ2: Are

    developers aware of the impact of breaking changes on client applications? Research Questions
  20. 20 Five main reasons

  21. 21 “The change leads to better and more developer-friendly code

    (for example, to more fluent code).” [D2]
  22. 22 “The classes/methods/fields are not removed all, they are just

    refactored to a better package signature.” [D6]
  23. 23 “Bugfix. For example some of the items shouldn’t be

    accessible and were made private.” [D3]
  24. 24 “We switched the assertion library on which the library

    was based.” [D4]
  25. 25 “It’s a deliberate policy. bitcoinj has never done a

    1.0 release that would have posted API stability.” [D7]
  26. 26 RQ1: Why do developers break API contracts? RQ2: Are

    developers aware of the impact of breaking changes on client applications? Research Questions
  27. 27 SEVEN ANSWERS

  28. 28 FIVE AWARE SEVEN ANSWERS

  29. 29 FIVE AWARE TWO UNCLEAR SEVEN ANSWERS

  30. 30 FIVE AWARE TWO UNCLEAR SEVEN ANSWERS “Once one client

    asked to use @Deprecated on old methods, but we simply don’t have enough resources to maintain all deprecated methods.” [D2]
  31. 31 FIVE AWARE TWO UNCLEAR SEVEN ANSWERS “Yes. But we

    are not Spring yet. [...] Being a small-to-middle library has it’s benefits.” [D2]
  32. 32 Five main reasons why developers break APIs

  33. 33 Five main reasons why developers break APIs Most developers

    are aware of the impact
  34. 34 Five main reasons why developers break APIs Most developers

    are aware of the impact In some cases, they adopt strategies to mitigate
  35. 35 Five main reasons why developers break APIs Most developers

    are aware of the impact In some cases, they adopt strategies to mitigate New study contacting developers right after a commit with a breaking change
  36. Why do you break APIs? 36

  37. Why do you break APIs? 37 Are you aware about

    the impact?
  38. Why Do We Break APIs? First Answers from Developers Laerte

    Xavier, André Hora, Marco Tulio Valente Federal University of Minas Gerais, Brazil SANER 2017 ERA Track