51
Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study Laerte Xavier, Aline Brito, André Hora, Marco Tulio Valente Federal University of Minas Gerais, Brazil SANER 2017

Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

Embed Size (px)

Citation preview

Page 1: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

Laerte Xavier, Aline Brito, André Hora, Marco Tulio ValenteFederal University of Minas Gerais, Brazil

SANER 2017

Page 2: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

2

API

Page 3: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

APIs are constantlychanging!

3

Page 4: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

4

Page 5: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

5

default Query<R> setHibernateFlushMode(FlushMode flushMode) {

setFlushMode( flushMode );

return this;

}

default org.hibernate.query.Query<R> setHibernateFlushMode(FlushMode

flushMode) {

setFlushMode( flushMode );

return (org.hibernate.query.Query) this;

}

hibernate/hibernate-orm

Version 5.2.0

Page 6: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

6Version 5.2.0

default org.hibernate.query.Query<R> setHibernateFlushMode(FlushMode

flushMode) {

setFlushMode( flushMode );

return (org.hibernate.query.Query) this;

}

Page 7: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

7

Breaking Changes

Elements removal

Method signature changes

Non-Breaking Changes

Changes in deprecated elements

Elements addition

Elements deprecationField changes

(Dig and Johnson, ICSM, 2006)

Page 8: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

8

Related Work

Hora and Valente, ICSME, 2015

Hora et al., CSMR, 2014

Henkel and Diwan, ICSE, 2005

Raemaekers et al., ICSM, 2012

API Evolution Change Impact

Brito et al., SANER, 2016

McDonnel et al., ICSE, 2013

Page 9: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

Trabalhos Relacionados

Hora and Valente, 2015;

Hora et al., 2014;

Henkel and Diwan, 2005.

Raemaekers et al., 2012;

Evolução de APIs Impacto de Mudanças

Brito et al., 2016;

McDonnel et al., 2013.

Open Questions

9

To what extent are clients affected by API breaking changes?

Page 10: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

Trabalhos Relacionados

Hora and Valente, 2015;

Hora et al., 2014;

Henkel and Diwan, 2005.

Raemaekers et al., 2012;

Evolução de APIs Impacto de Mudanças

Brito et al., 2016;

McDonnel et al., 2013.

To what extent are clients affected by API breaking changes?

Open Questions

10

Is this a problem only faced by newer libraries?

Page 11: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

11

RQ1: What is the frequency of API breaking changes?

RQ2: How do API breaking changes evolve over time?

RQ3: What is the impact of API breaking changes in client applications?

RQ4: What are the characteristics of libraries with high and low frequency of breaking changes?

Page 12: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

12

TOP-317GITHUB JAVA LIBRARIES

Page 13: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

13

TOP-3171,792

STARS

GITHUB JAVA LIBRARIES

Page 14: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

14

TOP-3171,792

STARS

15RELEASES

GITHUB JAVA LIBRARIES

Page 15: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

15

TOP-3171,792

STARS

15RELEASES

3.4YEARS

GITHUB JAVA LIBRARIES

Page 16: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

16

RQ1: What is the frequency of API breaking changes?

RQ2: How do API breaking changes evolve over time?

RQ3: What is the impact of API breaking changes in client applications?

RQ4: What are the characteristics of libraries with high and low frequency of breaking changes?

Page 17: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

17

...1 2 NN-1

Design

3 N-2

First Commit

August2016

Page 18: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

18

...1 2 NN-1

Design

3 N-2

First Commit

August2016

DIFF

Page 19: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

19

501,645LIBRARY

CHANGES

28%BREAKING CHANGES

Page 20: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

20

501,645LIBRARY

CHANGES

28%BREAKING CHANGES

Page 21: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

21

501,645LIBRARY

CHANGES

28%BREAKING CHANGES

Page 22: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

22

Libraries often break backward compatibility!

Page 23: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

23

RQ1: What is the frequency of API breaking changes?

RQ2: How do API breaking changes evolve over time?

RQ3: What is the impact of API breaking changes in client applications?

RQ4: What are the characteristics of libraries with high and low frequency of breaking changes?

Page 24: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

24

...1 2 NN-1

Design

3 N-2

First Commit

August2016

Page 25: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

25

...1 2 NN-1

Design

3 N-2

First Commit

August2016

DIFF

Page 26: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

DIFF

26

...1 2 NN-1

Design

3 N-2

First Commit

August2016

DIFF

Page 27: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

DIFFDIFF

27

...1 2 NN-1

Design

3 N-2

First Commit

August2016

DIFF

Page 28: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

DIFFDIFFDIFFDIFFDIFFDIFF

28

1

...2 NN-1

Design

3 N-2

First Commit

August2016

DIFF

Page 29: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

29

9,329RELEASES

5YEARS

Page 30: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

30

9,329RELEASES YEARS

20%

5

Page 31: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

31

Breaking changes frequency increases over time!

Page 32: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

32

RQ1: What is the frequency of API breaking changes?

RQ2: How do API breaking changes evolve over time?

RQ3: What is the impact of API breaking changes in client applications?

RQ4: What are the characteristics of libraries with high and low frequency of breaking changes?

Page 33: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

DIFF

33

NN-1

Design

JAVALI

263,425 Projects

16,386,193Files

http://java.labsoft.dcc.ufmg.br/javali

Boa

Page 34: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

34

140,460BREAKING CHANGES

16,291CHANGED TYPES

1,290TYPES WITH

POSSIBLE IMPACT

Page 35: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

35

140,460BREAKING CHANGES

16,291CHANGED TYPES

1,290TYPES WITH

POSSIBLE IMPACT

Page 36: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

36

Most breaking changes do not have a massive

impact on clients!

Page 37: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

37

RQ1: What is the frequency of API breaking changes?

RQ2: How do API breaking changes evolve over time?

RQ3: What is the impact of API breaking changes in client applications?

RQ4: What are the characteristics of libraries with high and low frequency of breaking changes?

Page 38: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

Design

38

Page 39: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

Design

Top (58)

Bottom (58)

0% BC

100% BC

39

Page 40: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

Design

Top (58)

Bottom (58)

0% BC

100% BC

(Mann-Whitney U Test & Cliff’s Delta)

40

Page 41: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

Bold: p-value < 0.05 (statistically significant different) and d > 0.147 (at least small size effect)

41

Page 42: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

Bold: p-value < 0.05 (statistically significant different) and d > 0.147 (at least small size effect)

42

Page 43: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

43

Development and social coding measures are associated with API breaking changes!

Page 44: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

Trabalhos Relacionados

Hora and Valente, 2015;

Hora et al., 2014;

Henkel and Diwan, 2005.

Raemaekers et al., 2012;

Evolução de APIs Impacto de Mudanças

Brito et al., 2016;

McDonnel et al., 2013.

To what extent are clients affected by API breaking changes?

Open Questions

44

Is this a problem only faced by newer libraries?

Page 45: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

45

Libraries often break backward compatibility

Page 46: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

46

Libraries often break backward compatibility

Breaking changes frequency increases over time

Page 47: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

47

Libraries often break backward compatibility

Breaking changes frequency increases over time

Most breaking changes do not have a massive impact on clients

Page 48: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

48

Libraries often break backward compatibility

Breaking changes frequency increases over time

Most breaking changes do not have a massive impact on clients

Development and social coding measures are associated with API breaking changes

Page 49: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

49

Would you need tools to measure the impact of breaking changes?

As an API developer...

Page 50: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

50

Would you use stability metrics to choose an API?

Would you need tools to measure the impact of breaking changes?

As an API developer...

As an API client...

Page 51: Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

Historical and Impact Analysis of API Breaking Changes: A Large-Scale Study

Laerte Xavier, Aline Brito, André Hora, Marco Tulio ValenteFederal University of Minas Gerais, Brazil

SANER 2017