Why Do We Break APIs?First Answers from Developers
Laerte Xavier, André Hora, Marco Tulio ValenteFederal University of Minas Gerais, Brazil
SANER 2017 ERA Track
2
Breaking API contracts is a common practice!
API changes break compatiblity
28%Historical and Impact Analysis of API Breaking Changes:
A Large-Scale Study, SANER, 20173
4
The rate of breaking changes increases over time!
Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study, SANER, 2017
5
What specific reasons motivate API breaking changes?
6
RQ1: Why do developers break API contracts?
RQ2: Are developers aware of the impact of breaking changes on client applications?
Research Questions
7
TOP-317GITHUB JAVA LIBRARIES
8
TOP-317GITHUB JAVA LIBRARIES
90LIBRARIES WITH MORE
THAN 50 BREAKING CHANGES
9
TOP-31790
49EMAILS FROM MAJOR
CONTRIBUTORS
GITHUB JAVA LIBRARIES
LIBRARIES WITH MORE THAN 50 BREAKING
CHANGES
49EMAILS
SENT 10
49EMAILS
SENT
14ANSWERSRECEIVED 11
49EMAILS
SENT
14ANSWERSRECEIVED
28%RESPONSE
RATE 12
13
49EMAILS
SENT
14ANSWERSRECEIVED
7EMAILS
SELECTED RESPONSE
RATE
28%
14
15
16
17
18
19
RQ1: Why do developers break API contracts?
RQ2: Are developers aware of the impact of breaking changes on client applications?
Research Questions
20
Five main reasons
21
“The change leads to better and more developer-friendly code (for example, to more fluent code).” [D2]
22
“The classes/methods/fields are not removed all, they are just refactored to a better package signature.” [D6]
23
“Bugfix. For example some of the items shouldn’t be accessible and were made private.” [D3]
24
“We switched the assertion library on which the library was based.” [D4]
25
“It’s a deliberate policy. bitcoinj has never done a 1.0 release that would have posted API stability.” [D7]
26
RQ1: Why do developers break API contracts?
RQ2: Are developers aware of the impact of breaking changes on client applications?
Research Questions
27
SEVENANSWERS
28
FIVEAWARE
SEVENANSWERS
29
FIVEAWARE
TWOUNCLEAR
SEVENANSWERS
30
FIVEAWARE
TWOUNCLEAR
SEVENANSWERS
“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
FIVEAWARE
TWOUNCLEAR
SEVENANSWERS
“Yes. But we are not Spring yet. [...] Being a
small-to-middle library has it’s benefits.” [D2]
32
Five main reasons why developers break APIs
33
Five main reasons why developers break APIs
Most developers are aware of the impact
34
Five main reasons why developers break APIs
Most developers are aware of the impact
In some cases, they adopt strategies to mitigate
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
Why do you break APIs?
36
Why do you break APIs?
37
Are you aware about the impact?
Why Do We Break APIs?First Answers from Developers
Laerte Xavier, André Hora, Marco Tulio ValenteFederal University of Minas Gerais, Brazil
SANER 2017 ERA Track