A Compositional Paradigm of Automating Refactorings

  • Mohsen Vakilian
  • Nicholas Chen
  • Roshanak Zilouchian Moghaddam
  • Stas Negara
  • Ralph E. Johnson
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7920)

Abstract

Recent studies suggest that programmers greatly underuse refactoring tools, especially for complex refactorings. Complex refactorings tend to be tedious and error-prone to perform by hand. To promote the use of refactoring tools for complex changes, we propose a new paradigm for automating refactorings called compositional refactoring. The key idea is to perform small, predictable changes using a tool and manually compose them into complex changes. This paradigm trades off some level of automation by higher predictability and control. We show that this paradigm is natural, because our analysis of programmers’ use of the Eclipse refactoring tool in the wild shows that they frequently batch and compose automated refactorings. We then show that programmers are receptive to this new paradigm through a survey of 100 respondents. Finally, we show that the compositional paradigm is effective through a controlled study of 13 professional programmers, comparing this paradigm to the existing wizard-based one.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    The R Project for Statistical Computing, http://www.r-project.org/
  2. 2.
    Bainbridge, L.: Ironies of Automation. Automatica, 775–779 (1983)Google Scholar
  3. 3.
    Cinnéide, M.Ó.: Automated Application of Design Patterns: A Refactoring Approach. Ph.D. thesis, Univ. of Dublin, Trinity College (2000)Google Scholar
  4. 4.
    Dig, D., Marrero, J., Ernst, M.D.: Refactoring Sequential Java Code for Concurrency via Concurrent Libraries. In: Proc. ICSE, pp. 397–407 (2009)Google Scholar
  5. 5.
    Foster, S., Griswold, W.G., Lerner, S.: WitchDoctor: IDE Support for Real-Time Auto-Completion of Refactorings. In: Proc. ICSE, pp. 222–232 (2012)Google Scholar
  6. 6.
    Fowler, M.: Refactoring: Improving the Design of Existing Code. Addison-Wesley (1999)Google Scholar
  7. 7.
    Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley (1995)Google Scholar
  8. 8.
    Ge, X., DuBose, Q.L., Murphy-Hill, E.: Reconciling Manual and Automatic Refactoring. In: Proc. ICSE, pp. 211–221 (2012)Google Scholar
  9. 9.
    Griswold, W.G.: Program Restructuring as an Aid to Software Maintenance. Ph.D. thesis, Univ. of Washington (1991)Google Scholar
  10. 10.
    Han, J., Kamber, M., Pei, J.: Data Mining: Concepts and Techniques, 3rd edn. Morgan Kaufmann (2011)Google Scholar
  11. 11.
    Kerievsky, J.: Refactoring to Patterns. Pearson Higher Education (2004)Google Scholar
  12. 12.
    Kirlik, A.: Modeling Strategic Behavior in Human-Automation Interaction: Why an “Aid” Can (and Should) Go Unused. J. Human Factors and Ergonomics Soc., 221–242 (1993)Google Scholar
  13. 13.
    Kjolstad, F., Dig, D., Acevedo, G., Snir, M.: Transformation for Class Immutability. In: Proc. ICSE. pp. 61–70 (2011)Google Scholar
  14. 14.
    Kniesel, G., Koch, H.: Static Composition of Refactorings. Sci. Comput. Program. pp. 9–51 (2004)Google Scholar
  15. 15.
    Lee, Y.Y., Chen, N., Johnson, R.E.: Drag-and-Drop Refactoring: Intuitive and Efficient Program Transformation. In: ICSE (2013)Google Scholar
  16. 16.
    Li, H., Thompson, S.: A Domain-Specific Language for Scripting Refactorings in Erlang. In: de Lara, J., Zisman, A. (eds.) FASE 2012. LNCS, vol. 7212, pp. 501–515. Springer, Heidelberg (2012)Google Scholar
  17. 17.
    Murphy, G.C., Kersten, M., Findlater, L.: How Are Java Software Developers Using the Eclipse IDE? IEEE Software pp. 76–83 (2006)Google Scholar
  18. 18.
    Murphy-Hill, E., Black, A.P.: Breaking the Barriers to Successful Refactoring: Observations and Tools for Extract Method. In: Proc. ICSE, pp. 421–430 (2008)Google Scholar
  19. 19.
    Murphy-Hill, E., Parnin, C., Black, A.P.: How We Refactor, and How We Know It. IEEE Trans. Software Eng. pp. 5–18 (2011)Google Scholar
  20. 20.
    Negara, S., Chen, N., Vakilian, M., Johnson, R.E., Dig, D.: A Comparative Study of Manual and Automated Refactorings. In: Castagna, G. (ed.) ECOOP 2013. LNCS, vol. 7920, pp. 552–576. Springer, Heidelberg (2013)Google Scholar
  21. 21.
    Opdyke, W.F.: Refactoring Object-Oriented Frameworks. Ph.D. thesis, Univ. of Illinois at Urbana-Champaign (1992)Google Scholar
  22. 22.
    Parnin, C., Görg, C., Rugaber, S.: CodePad: Interactive Spaces for Maintaining Concentration in Programming Environments. In: Proc. SoftVis. pp. 15–24 (2010)Google Scholar
  23. 23.
    Roberts, D., Brant, J., Johnson, R.: A Refactoring Tool for Smalltalk. Theor. Pract. Object Syst. pp. 253–263 (1997)Google Scholar
  24. 24.
    Roberts, D.B.: Practical Analysis for Refactoring. Ph.D. thesis, Univ. of Illinois at Urbana-Champaign (1999)Google Scholar
  25. 25.
    Schäfer, M., Sridharan, M., Dolby, J., Tip, F.: Refactoring Java Programs for Flexible Locking. In: Proc. ICSE. pp. 71–80 (2011)Google Scholar
  26. 26.
    Schäfer, M., Verbaere, M., Ekman, T., de Moor, O.: Stepping Stones over the Refactoring Rubicon. In: Drossopoulou, S. (ed.) ECOOP 2009. LNCS, vol. 5653, pp. 369–393. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  27. 27.
    Vakilian, M., Chen, N., Negara, S., Rajkumar, B.A., Bailey, B.P., Johnson, R.E.: Use, Disuse, and Misuse of Automated Refactorings. In: Proc. ICSE, pp. 233–243 (2012)Google Scholar
  28. 28.
    Vakilian, M., Chen, N., Negara, S., Rajkumar, B.A., Zilouchian Moghaddam, R., Johnson, R.E.: The Need for Richer Refactoring Usage Data. In: Proc. PLATEAU, pp. 31–38 (2011)Google Scholar
  29. 29.
    Vakilian, M., Dig, D., Bocchino Jr., R.L., Overbey, J.L., Adve, V., Johnson, R.: Inferring Method Effect Summaries for Nested Heap Regions. In: Proc. ASE, pp. 421–432 (2009)Google Scholar
  30. 30.
    Verbaere, M., Ettinger, R., de Moor, O.: JunGL: A Scripting Language for Refactoring. In: Proc. ICSE, pp. 172–181 (2006)Google Scholar
  31. 31.
    Vicente, K.J.: Less is (sometimes) more in cognitive engineering: the role of automation technology in improving patient safety. Qual Saf Health Care, pp. 291–294 (2003)Google Scholar
  32. 32.
    Ryan, W., Bernard, G.,, H.R.: Data Management and Analysis Methods. In: Handbook of Qualitative Research, 2nd edn. SAGE Publications (2011)Google Scholar
  33. 33.
    Wloka, J., Sridharan, M., Tip, F.: Refactoring for Reentrancy. In: Proc. ESEC/FSE, pp. 173–182 (2009)Google Scholar
  34. 34.
    Xing, Z., Stroulia, E.: Refactoring Practice: How it is and How it Should be Supported – An Eclipse Case Study. In: Proc. ICSM, pp. 458–468 (2006)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Mohsen Vakilian
    • 1
  • Nicholas Chen
    • 1
  • Roshanak Zilouchian Moghaddam
    • 1
  • Stas Negara
    • 1
  • Ralph E. Johnson
    • 1
  1. 1.University of Illinois at Urbana-ChampaignUSA

Personalised recommendations