Type Migration in Ultra-Large-Scale Codebases

Type migration is a refactoring activity in which an existing type is replaced with another one throughout the source code. Manually performing type migration is tedious as programmers need to find all instances of the type to be migrated, along with its dependencies that propagate over assignment operations, method hierarchies, and subtypes. Existing automated approaches for type migration are not adequate for ultra-large-codebases - they perform an intensive whole-program analysis that does not scale. If we could represent the type structure of the program as graphs, then we could employ a MAPREDUCE parallel and distributed process that scales to hundreds of millions of LOC. We implemented this approach as an IDE-independent tool called T2R, which integrates with most build systems. We evaluated T2R's accuracy, usefulness and scalability on seven open source projects and one proprietary codebase of 300M LOC. T2R generated 130 type migration patches, of which the original developers accepted 98%.

[1]  Robert J. Walker,et al.  Seeking the ground truth: a retroactive study on the evolution and migration of software libraries , 2012, SIGSOFT FSE.

[2]  Frank Tip,et al.  Refactoring support for class library migration , 2005, OOPSLA '05.

[3]  Stas Negara,et al.  ReBA , 2008, 2008 ACM/IEEE 30th International Conference on Software Engineering.

[4]  Victor L. Winter,et al.  Generative programming techniques for Java library migration , 2007, GPCE '07.

[5]  Craig Chambers,et al.  FlumeJava: easy, efficient data-parallel pipelines , 2010, PLDI '10.

[6]  Ralf,et al.  Swing to SWT and back: Patterns for API migration by wrapping , 2010, ICSM 2010.

[7]  Wei Wu,et al.  AURA: a hybrid approach to identify framework evolution , 2010, 2010 ACM/IEEE 32nd International Conference on Software Engineering.

[8]  Xavier Blanc,et al.  A study of library migrations in Java , 2014, J. Softw. Evol. Process..

[9]  Robert J. Walker,et al.  Refactoring references for library migration , 2010, OOPSLA.

[10]  J. Henkel,et al.  CatchUp! Capturing and replaying refactorings to support API evolution , 2005, Proceedings. 27th International Conference on Software Engineering, 2005. ICSE 2005..

[11]  Raffi Khatchadourian,et al.  Automated refactoring of legacy Java software to enumerated types , 2007, 2007 IEEE International Conference on Software Maintenance.

[12]  Frank Tip,et al.  Refactoring for generalization using type constraints , 2003, OOPSLA 2003.

[13]  Foutse Khomh,et al.  Getting the most from map data structures in Android , 2018, Empirical Software Engineering.

[14]  David Notkin,et al.  Semi-automatic update of applications in response to library changes , 1996, 1996 Proceedings of International Conference on Software Maintenance.

[15]  Frank Tip,et al.  Refactoring using type constraints , 2011, TOPL.

[16]  Xavier Blanc,et al.  Mining Library Migration Graphs , 2012, 2012 19th Working Conference on Reverse Engineering.

[17]  Tom Mens,et al.  Formalising Behaviour Preserving Program Transformations , 2002, ICGT.

[18]  Jun Li,et al.  SWIN: Towards Type-Safe Java Program Adaptation between APIs , 2015, PEPM.

[19]  Qing Wang,et al.  Mining API mapping for language migration , 2010, 2010 ACM/IEEE 32nd International Conference on Software Engineering.

[20]  Hyrum K. Wright,et al.  Large-Scale Automated Refactoring Using ClangMR , 2013, 2013 IEEE International Conference on Software Maintenance.

[21]  Sanjay Ghemawat,et al.  MapReduce: Simplified Data Processing on Large Clusters , 2004, OSDI.

[22]  Jens Dietrich,et al.  Broken promises: An empirical study into evolution problems in Java programs caused by library upgrades , 2014, 2014 Software Evolution Week - IEEE Conference on Software Maintenance, Reengineering, and Reverse Engineering (CSMR-WCRE).

[23]  David Notkin,et al.  Using twinning to adapt programs to alternative APIs , 2010, 2010 ACM/IEEE 32nd International Conference on Software Engineering.

[24]  Xavier Blanc,et al.  Automatic discovery of function mappings between similar libraries , 2013, 2013 20th Working Conference on Reverse Engineering (WCRE).

[25]  Eleni Stroulia,et al.  API-Evolution Support with Diff-CatchUp , 2007, IEEE Transactions on Software Engineering.

[26]  Frank Tip,et al.  Efficiently Refactoring Java Applications to Use Generic Libraries , 2005, ECOOP.

[27]  Aart J. C. Bik,et al.  Pregel: a system for large-scale graph processing , 2010, SIGMOD Conference.

[28]  Miryung Kim,et al.  A graph-based approach to API usage adaptation , 2010, OOPSLA.

[29]  Eric Bodden,et al.  RefaFlex: safer refactorings for reflective Java programs , 2012, ISSTA 2012.

[30]  Danny Dig,et al.  Understanding the use of lambda expressions in Java , 2017, Proc. ACM Program. Lang..

[31]  Frank Tip,et al.  Class hierarchy specialization , 2000, Acta Informatica.