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

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.

ASERG, DCC, UFMG

February 22, 2017
Tweet

More Decks by ASERG, DCC, UFMG

Other Decks in Research

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

    View Slide

  2. 2
    Breaking API contracts is
    a common practice!

    View Slide

  3. API changes break
    compatiblity
    28%
    Historical and Impact Analysis of API Breaking Changes:
    A Large-Scale Study, SANER, 2017
    3

    View Slide

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

    View Slide

  5. 5
    What specific reasons motivate
    API breaking changes?

    View Slide

  6. 6
    RQ1: Why do developers break API contracts?
    RQ2: Are developers aware of the impact of
    breaking changes on client applications?
    Research Questions

    View Slide

  7. 7
    TOP-317
    GITHUB JAVA LIBRARIES

    View Slide

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

    View Slide

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

    View Slide

  10. 49
    EMAILS
    SENT
    10

    View Slide

  11. 49
    EMAILS
    SENT
    14
    ANSWERS
    RECEIVED
    11

    View Slide

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

    View Slide

  13. 13
    49
    EMAILS
    SENT
    14
    ANSWERS
    RECEIVED
    7
    EMAILS
    SELECTED
    RESPONSE
    RATE
    28%

    View Slide

  14. 14

    View Slide

  15. 15

    View Slide

  16. 16

    View Slide

  17. 17

    View Slide

  18. 18

    View Slide

  19. 19
    RQ1: Why do developers break API contracts?
    RQ2: Are developers aware of the impact of
    breaking changes on client applications?
    Research Questions

    View Slide

  20. 20
    Five main reasons

    View Slide

  21. 21
    “The change leads to better and more developer-friendly
    code (for example, to more fluent code).” [D2]

    View Slide

  22. 22
    “The classes/methods/fields are not removed all, they are
    just refactored to a better package signature.” [D6]

    View Slide

  23. 23
    “Bugfix. For example some of the items shouldn’t be
    accessible and were made private.” [D3]

    View Slide

  24. 24
    “We switched the assertion library on which the library
    was based.” [D4]

    View Slide

  25. 25
    “It’s a deliberate policy. bitcoinj has never done a 1.0
    release that would have posted API stability.” [D7]

    View Slide

  26. 26
    RQ1: Why do developers break API contracts?
    RQ2: Are developers aware of the impact of
    breaking changes on client applications?
    Research Questions

    View Slide

  27. 27
    SEVEN
    ANSWERS

    View Slide

  28. 28
    FIVE
    AWARE
    SEVEN
    ANSWERS

    View Slide

  29. 29
    FIVE
    AWARE
    TWO
    UNCLEAR
    SEVEN
    ANSWERS

    View Slide

  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]

    View Slide

  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]

    View Slide

  32. 32
    Five main reasons why developers break APIs

    View Slide

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

    View Slide

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

    View Slide

  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

    View Slide

  36. Why do you break
    APIs?
    36

    View Slide

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

    View Slide

  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

    View Slide