Slide 1

Slide 1 text

On  So&ware  Changes:   Versioning  in  the  Maven  ecosystem     Arie  van  Deursen     Joint  work  with   Steven  Raemaekers   Joost  Visser   1  

Slide 2

Slide 2 text

2  

Slide 3

Slide 3 text

3  

Slide 4

Slide 4 text

A  Coordinate  System  for     So&ware  EvoluEon   4   “Business  value”   “Agility”   v1   v2   v3   v4   v5  

Slide 5

Slide 5 text

5  

Slide 6

Slide 6 text

Disciplined  development   6   Business  value   Agility   v1   v2  

Slide 7

Slide 7 text

Pure  Refactoring   7   Business  value   Agility   v1   v2  

Slide 8

Slide 8 text

Quick  and  Dirty   8   Business  value   Agility   v1   v2  

Slide 9

Slide 9 text

9  

Slide 10

Slide 10 text

We  Need  to  Study   So&ware  Change   10   Requirements   DocumentaEon   Issue  Tracker   Test  Reports   What  can  we   learn  from   so&ware   repositories?   Time   Source  Control  

Slide 11

Slide 11 text

Change     Granularity   •  Edit   •  Commit   •  Bug  fix   •  Pull  request   •  User  visible  feature     •  Project  /  API  release   •  Product  delivery   11   flickr.com/photos/wackybadger/  

Slide 12

Slide 12 text

The  Maven  Dataset   •  150,000  released  jar  files   •  100,000  with  source   •  As  in  Maven  Central  on  July  30,  2011   •  With  resolved  usage  data   12  

Slide 13

Slide 13 text

Research  QuesEons   •  How  do  API  developers  deal  with  breaking   changes?   •  How  common  are  breaking  changes?   •  Do  version  numbers  help  to  esEmate  breaking   changes?   •  What  factors  affect  introducEon  of  breaking   changes?   13  

Slide 14

Slide 14 text

Breaking  Changes  in  APIs   14   1. // Version 1 of Lib1 1. public class Lib1 { 2. public void foo() {...} 3. public int doStuff() {...} 4. } 1. // method2 uses foo & doStuff 1. public class System1 { 2. public void method2() { 3. Lib1 c1 = new Lib1(); 4. c1.foo(); 5. int x = c1.doStuff(); 6. anUnrelatedChange(); 7. }} 1. // Version 2 of Lib1 1. public class Lib1 { 2. public void foo(int bar) {...} 3. public String doStuff() {...} 4. } 1. // method2 uses foo & doStuff 1. public class System1 { 2. public void method2() { 3. Lib1 c1 = new Lib1(); 4. c1.foo(); 5. int x = c1.doStuff(); 6. } 7. }

Slide 15

Slide 15 text

Binary   Incompa-bili-es   Focus  of  study:   Removals:  Interface,  class,  method,  or  field   Changes:      Nr  of  parameters,  or  change  in                                            field  /  parameter  /  return  type   15   “Pre-­‐exis-ng  client  binaries  must  link  and  run  with  new  releases   of  the  component  without  recompiling.”  -­‐-­‐-­‐  the  CLIRR  tool.   flickr.com/photos/dullhunk/  

Slide 16

Slide 16 text

Public  Method  /  Class  Removals   in  8  versions  of  H2DB   16  

Slide 17

Slide 17 text

In  all  Maven’s  90,000  Update  Pairs:   17  

Slide 18

Slide 18 text

Is  Anything  Being  Broken?   •  Maven  libraries  depend  on  ...  each  other   – S  uses  L;     – L  updated  to  L’;   – Will  S  compile  with  L’?   •  Assess  impact  by  step  by  step    injec-on  of   breaking  changes   18   InjecEng  breaking  changes  leads  to  14,000,000   compile  errors  with  Maven  set  alone  

Slide 19

Slide 19 text

Does  Versioning  Help?   Major  .  Minor  .  Patch  in  SemVer   •  Major:  incremented  when     incompaEble  API  changes  are  made   •  Minor:  incremented  when  funcEonality  is   added  in  backward  compaEble  manner   •  Patch:  incremented  when     backward-­‐compaEble  bug  fixes  are  made   19   semver.org:  Based  on     “pre-­‐exis-ng  widespread  common  prac-ces”  

Slide 20

Slide 20 text

20  

Slide 21

Slide 21 text

21   What  about   breaking   changes?  

Slide 22

Slide 22 text

Breaking  Changes  over  Time   22  

Slide 23

Slide 23 text

DeprecaEon  to  the  Rescue!   “Depreca-ng  exis-ng  func-onality  is  a  normal   part  of  soAware  development  and  is  oAen   required”  (semver)     DeprecaEon  in  semanEc  versioning:   1.  Update  documentaEon   2.  Introduce  deprecaEon  in  minor  release   3.  A&er  that  remove  method  in  major  release   23  

Slide 24

Slide 24 text

DeprecaEon  to  the  Rescue?   Depreca

Slide 25

Slide 25 text

DeprecaEon  to  the  Rescue?   Depreca

Slide 26

Slide 26 text

Does  Size  Maoer?   26   0 2 4 6 8 10 log(#Breaking changes) 2 3 4 5 6 7 8 9 log(Number of methods)

Slide 27

Slide 27 text

Does  Age  Maoer?   •  Maturity  =  release  index  =   number  of  versions  of  library  unEl  now   •  Correlate  release  index  with  #  breaking   changes   •  More  mature  libraries  introduce  fewer   breaking  changes  (r  =  -­‐0.3,  p  =  0)   27  

Slide 28

Slide 28 text

When  Is  Impact  Dispersed?   28  

Slide 29

Slide 29 text

When  Is  Impact  Dispersed?   •  Dependent  variable:   – DisEnct  methods  with  error  due  to  update   •  Independent  variables:   – Age  (release  index)   – Size  (number  of  methods)   – Library  popularity  (usage  frequency  in  maven).   29  

Slide 30

Slide 30 text

When  Is  Impact  Dispersed?   30  

Slide 31

Slide 31 text

Discussion   •  Maven  data  set:  Very  rich  resource   •  A  breaking  API  is  a  fact  of  life   – DeprecaEon  is  not  adopted.   – Old  is  beoer   – Large  is  worse   •  Dispersion  affected  by  size,  age,  and   popularity   31  

Slide 32

Slide 32 text

Discussion   •  Is  Java’s  (lack  of)  modularizaEon  to  blame?   •  Maven  analyEcs   with  IDE  support?   •  Just  Maven  Central?   –  Commercial  (maven-­‐based)  systems   –  .NET  nuget,  Ruby  gems,  web  services   32  

Slide 33

Slide 33 text

Discussion   •  Beyond  syntacEc  incompaEbiliEes?   – Include  test  suites  in  analysis?   – Study  contracts,  LSP,  SOLID,  …   •  “Breaking  an  API  is  bad”,  versus   “cleaning  up  an  API  is  good”   33  

Slide 34

Slide 34 text

The  Future  of  Programming?   •  To  know  the  future,  we  must  see  the  past   •  We  are  incompaEble   •  Change  must  become  a  first-­‐class  ciEzen   34  

Slide 35

Slide 35 text

Further  Reading   •  Steven  Raemaekers,  Arie  van  Deursen,  Joost  Visser:   The  maven  repository  dataset  of  metrics,  changes,  and   dependencies.  MSR  2013:  221-­‐224   •  Steven  Raemaekers,  Gabriela  F.  Nane,  Arie  van   Deursen,  Joost  Visser:  TesEng  principles,  current   pracEces,  and  effects  of  change  localizaEon.  MSR   2013:  257-­‐266   •  Steven  Raemaekers,  Arie  van  Deursen,  Joost  Visser:   Measuring  so&ware  library  stability  through  historical   version  analysis.  ICSM  2012:  378-­‐387   35