Abstract
The efficiency of a build system is an important factor for developer productivity. As a result, developer teams have been increasingly adopting new build systems that allow higher build parallelization. However, migrating the existing legacy build scripts to new build systems is a tedious and error-prone process. Unfortunately, there is insufficient support for automated migration of build scripts, making the migration more problematic.
We propose the first dynamic approach for automated migration of build scripts to new build systems. Our approach works in two phases. First, from a set of execution traces, we synthesize build scripts that accurately capture the intent of the original build. The synthesized build scripts are typically long and hard to maintain. Second, we apply refactorings that raise the abstraction level of the synthesized scripts (e.g., introduce functions for similar fragments). As different refactoring sequences may lead to different build scripts, we use a search-based approach that explores various sequences to identify the best (e.g., shortest) build script. We optimize search-based refactoring with partial-order reduction to faster explore refactoring sequences. We implemented the proposed two phase migration approach in a tool called METAMORPHOSIS that has been recently used at Microsoft.
- Ant home page. http://ant.apache.org/.Google Scholar
- Buck home page. http://facebook.github.io/buck/.Google Scholar
- Fabricate home page. https://code.google.com/p/fabricate/.Google Scholar
- Build in the cloud. http://google-engtools.blogspot.com/2011/08/build-in-cloud-how-build-system-works.html.Google Scholar
- Gradle build init plugin. http://www.gradle.org/docs/current/userguide/build_init_plugin.html.Google Scholar
- MSBuild home page. http://msdn.microsoft.com/en-us/library/0k6kkbsd.aspx.Google Scholar
- Make home page. http://www.gnu.org/software/make/manual/html_node/index.html.Google Scholar
- Maven home page. http://maven.apache.org/.Google Scholar
- Memoize home page. https://github.com/kgaughan/memoize.py.Google Scholar
- NMake home page. http://msdn.microsoft.com/en-us/library/ms930369.aspx.Google Scholar
- Ninja home page. https://martine.github.io/ninja/.Google Scholar
- SCons home page. http://www.scons.org/.Google Scholar
- TPL home page. http://msdn.microsoft.com/en-us/library/dd537609.aspx.Google Scholar
- Vesta home page. http://www.vestasys.org/.Google Scholar
- H. Abdeen, S. Ducasse, H. Sahraoui, and I. Alloui. Automatic package coupling and cycle minimization. In WCRE, pages 103--112, 2009. Google Scholar
Digital Library
- B. Adams, H. Tromp, K. D. Schutter, and W. D. Meuter. Design recovery and maintenance of build systems. In ICSM, pages 114--123, 2007.Google Scholar
Cross Ref
- B. Adams, K. D. Schutter, H. Tromp, and W. D. Meuter. The evolution of the Linux build system. Electronic Communications of the ECEASST, 8:1--16, 2008.Google Scholar
- G. Antoniol, M. Di Penta, and M. Neteler. Moving to smaller libraries via clustering and genetic algorithms. In CSMR, page 307, 2003. Google Scholar
Digital Library
- M. Balazinska, E. Merlo, M. Dagenais, B. Lague, and K. Kontogiannis. Measuring clone based reengineering opportunities. In METRICS, pages 292--303, 1999. Google Scholar
Digital Library
- F. L. Bauer, R. Berghammer, M. Broy, W. Dosch, F. Geiselbrechtinger, R. Gnatz, E. Hangel, W. Hesse, B. Krieg-Brückner, A. Laut, T. Matzner, B. Möller, F. Nickl, H. Partsch, R. Pepper, K. Samelson, M. Wirsing, and H. Wössner, editors. The Munich Project CIP: The Wide Spectrum Language CIP-L, volume 183. 1985. Google Scholar
Digital Library
- T. Bodhuin, G. Canfora, and L. Troiano. SORMASA: A tool for suggesting model refactoring actions by metrics-led genetic algorithm. In WRT, pages 23--24, 2007.Google Scholar
- S. Bouktif, G. Antoniol, E. Merlo, and M. Neteler. A novel approach to optimize clone refactoring activity. In GECCO, pages 1885--1892, 2006. Google Scholar
Digital Library
- M. Bowman, L. Briand, and Y. Labiche. Solving the class responsibility assignment problem in object-oriented analysis with multi-objective genetic algorithms. Transactions on Software Engineering, 36(6): 817--837, 2010. Google Scholar
Digital Library
- M. Christakis, K. R. M. Leino, and W. Schulte. Formalizing and verifying a modern build language. In FM, pages 643--657, 2014.Google Scholar
Digital Library
- D. Coetzee, A. Bhaskar, and G. Necula. A model and framework for reliable build systems. Technical Report UCB/EECS-2012-27, University of California at Berkeley, 2012.Google Scholar
- K. D. Cooper, D. Subramanian, and L. Torczon. Adaptive optimizing compilers for the 21st century. J. Supercomput., 23(1):7--22, 2002. Google Scholar
Digital Library
- B. Daniel, T. Gvero, and D. Marinov. On test repair using symbolic execution. In ISSTA, pages 207--218, 2010. Google Scholar
Digital Library
- D. Dig, J. Marrero, and M. D. Ernst. Refactoring sequential Java code for concurrency via concurrent libraries. In ICSE, pages 397--407, 2009. Google Scholar
Digital Library
- A. F. Donaldson and A. Miller. Extending symmetry reduction techniques to a realistic model of computation. Electronic Notes in Theoretical Computer Science, 185: 63--76, 2007. Google Scholar
Digital Library
- D. Doval, S. Mancoridis, and B. S. Mitchell. Automatic clustering of software systems using a genetic algorithm. In STEP, page 73, 1999. Google Scholar
Digital Library
- D. Fatiregun, M. Harman, and R. M. Hierons. Evolving transformation sequences using genetic algorithms. In SCAM, pages 66--75, 2004. Google Scholar
Digital Library
- D. Fatiregun, M. Harman, and R. M. Hierons. Search-based amorphous slicing. In WCRE, pages 3--12, 2005. Google Scholar
Digital Library
- A. Feldthaus and A. Mîller. Semi-automatic rename refactoring for JavaScript. In OOPSLA, pages 323--338, 2013. Google Scholar
Digital Library
- C. Flanagan and P. Godefroid. Dynamic partial-order reduction for model checking software. In POPL, pages 110--121, 2005. Google Scholar
Digital Library
- S. Forrest, T. Nguyen, W. Weimer, and C. Le Goues. A genetic programming approach to automated software repair. In GECCO, pages 947--954, 2009. Google Scholar
Digital Library
- W. Guttmann, H. Partsch, W. Schulte, and T. Vullinghs. Tool support for the interactive derivation of formally correct functional programs. Journal of Universal Computer Science, 9(2):173--188, 2003.Google Scholar
- R. Hardt and E. Munson. Ant build maintenance with Formiga. In RELENG, pages 13--16, 2013. Google Scholar
Digital Library
- M. Harman. Refactoring as testability transformation. In ICSTW, pages 414--421, 2011. Google Scholar
Digital Library
- M. Harman and L. Tratt. Pareto optimal search based refactoring at the design level. In GECCO, pages 1106--1113, 2007. Google Scholar
Digital Library
- Y. Higo, S. Kusumoto, and K. Inoue. A metric-based approach to identifying refactoring opportunities for merging code clones in a Java software system. J. Softw. Maint. Evol., 20(6):435--461, 2008. Google Scholar
Digital Library
- G. Holzmann. The SPIN Model Checker: Primer and Reference Manual. Addison-Wesley Professional, 2003. Google Scholar
Digital Library
- G. Hunt and D. Brubacher. Detours: Binary interception ofWin32 functions. In USENIX Windows NT Symposium, pages 135--143, 1998. Google Scholar
Digital Library
- R. Iosif. Exploiting heap symmetries in explicit-state model checking of software. In ASE, pages 254--261, 2001. Google Scholar
Digital Library
- M. Kim, T. Zimmermann, and N. Nagappan. A field study of refactoring challenges and benefits. In FSE, pages 1--11, 2012. Google Scholar
Digital Library
- C. Kirsopp, M. J. Shepperd, and J. Hart. Search heuristics, case-based reasoning and software project effort prediction. In GECCO, pages 1367--1374, 2002. Google Scholar
Digital Library
- C. Le Goues, M. Dewey-Vogt, S. Forrest, and W. Weimer. A systematic study of automated program repair: fixing 55 out of 105 bugs for $8 each. In ICSE, pages 3--13, 2012. Google Scholar
Digital Library
- S. McIntosh, B. Adams, and A. E. Hassan. The evolution of ANT build systems. In MSR, pages 42--51, 2010.Google Scholar
Cross Ref
- S. McIntosh, B. Adams, T. H. Nguyen, Y. Kamei, and A. E. Hassan. An empirical study of build maintenance effort. In ICSE, pages 141--150, 2011. Google Scholar
Digital Library
- B. S. Mitchell and S. Mancoridis. Using heuristic search techniques to extract design abstractions from source code. In GECCO, pages 1375--1382, 2002. Google Scholar
Digital Library
- E. Murphy-Hill, C. Parnin, and A. P. Black. How we refactor, and how we know it. In ICSE, pages 287--297, 2009. Google Scholar
Digital Library
- A. Neagu. What is wrong with Make? Jul 2005. http://freecode.com/articles/what-is-wrong-with-make.Google Scholar
- A. Neundorf. Why the KDE project switched to CMake - and how. Apr 2012. http://lwn.net/Articles/188693/.Google Scholar
- A. Nisbet. GAPS: A compiler framework for genetic algorithm (GA) optimised parallelisation. In HPCN, pages 987--989, 1998. Google Scholar
Digital Library
- M. O'Keeffe and M. O'Cinneide. Search-based software maintenance. In CSMR, pages 249--260, 2006. Google Scholar
Digital Library
- M. O'Keeffe and M. O'Cinneide. Search-based refactoring: an empirical study. J. Softw. Maint. Evol., 20(5):345--364, 2008. Google Scholar
Digital Library
- W. F. Opdyke. Refactoring Object-Oriented Frame-works. PhD thesis, University of Illinois at Urbana-Champaign, 1992. Google Scholar
Digital Library
- O. Räihä. A survey on search-based software design. Computer Science Review, 4(4):203--249, 2010. Google Scholar
Digital Library
- V. Raychev, M. Schäfer, M. Sridharan, and M. Vechev. Refactoring with synthesis. In OOPSLA, pages 339--354, 2013. Google Scholar
Digital Library
- D. Roberts, J. Brant, and R. Johnson. A refactoring tool for Smalltalk. Theor. Pract. Object Syst., 3(4):253--263, 1997. Google Scholar
Digital Library
- M. Schäfer, M. Sridharan, J. Dolby, and F. Tip. Refactoring Java programs for exible locking. In ICSE, pages 71--80, 2011. Google Scholar
Digital Library
- O. Seng, J. Stammel, and D. Burkhart. Search-based determination of refactorings for improving the class structure of object-oriented systems. In GECCO, pages 1909--1916, 2006. Google Scholar
Digital Library
- R. Suvorov, M. Nagappan, A. Hassan, Y. Zou, and B. Adams. An empirical study of build system migrations in practice: Case studies on KDE and the Linux kernel. In ICSM, pages 160--169, 2012. Google Scholar
Digital Library
- R. Tairas and J. Gray. Increasing clone maintenance support by unifying clone detection and refactoring activities. Inf. Softw. Technol., 54(12):1297--1307, 2012. Google Scholar
Digital Library
- A. Tamrawi, H. A. Nguyen, H. V. Nguyen, and T. Nguyen. SYMake: a build code analysis and refactoring tool for makefiles. In ASE, pages 366--369, 2012. Google Scholar
Digital Library
- M. Vakilian, N. Chen, S. Negara, B. A. Rajkumar, B. P. Bailey, and R. E. Johnson. Use, disuse, and misuse of automated refactorings. In ICSE, pages 233--243, 2012. Google Scholar
Digital Library
- M. Vakilian, R. Sauciuc, Morgenthaler, J. D., and V. Mirrokni. Automated decomposition of build targets. Technical report, University of Illinois at Urbana-Champaign, 2014.Google Scholar
- D. R. White, A. Arcuri, and J. A. Clark. Evolutionary improvement of programs. Trans. Evol. Comp, 15(4): 515--538, 2011. Google Scholar
Digital Library
- D. Whitfield and M. L. Soffa. An approach for exploring code-improving transformations. Trans. Program. Lang. Syst., 19(6):1053--1084, 1997. Google Scholar
Digital Library
Index Terms
Automated migration of build scripts using dynamic analysis and search-based refactoring
Recommendations
Automated migration of build scripts using dynamic analysis and search-based refactoring
OOPSLA '14: Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & ApplicationsThe efficiency of a build system is an important factor for developer productivity. As a result, developer teams have been increasingly adopting new build systems that allow higher build parallelization. However, migrating the existing legacy build ...
A sound and optimal incremental build system with dynamic dependencies
OOPSLA 2015: Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and ApplicationsBuild systems are used in all but the smallest software projects to invoke the right build tools on the right files in the right order. A build system must be sound (after a build, generated files consistently reflect the latest source files) and ...
Virtual Machine Migration Method between Different Hypervisor Implementations and Its Evaluation
WAINA '12: Proceedings of the 2012 26th International Conference on Advanced Information Networking and Applications WorkshopsVirtualization technologies are an important building block for cloud services. Each service will run on virtual machines (VMs) deployed over different hyper visors in the future. Therefore, a VM migration method between different hyper visor ...







Comments