Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.5555/2337223.2337250acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
Article

WitchDoctor: IDE support for real-time auto-completion of refactorings

Published: 02 June 2012 Publication History

Abstract

Integrated Development Environments (IDEs) have come to perform a wide variety of tasks on behalf of the programmer, refactoring being a classic example. These operations have undeniable benefits, yet their large (and growing) number poses a cognitive scalability problem. Our main contribution is WitchDoctor -- a system that can detect, on the fly, when a programmer is hand-coding a refactoring. The system can then complete the refactoring in the background and propose it to the user long before the user can complete it. This implies a number of technical challenges. The algorithm must be 1) highly efficient, 2) handle unparseable programs, 3) tolerate the variety of ways programmers may perform a given refactoring, 4) use the IDE's proven and familiar refactoring engine to perform the refactoring, even though the the refactoring has already begun, and 5) support the wide range of refactorings present in modern IDEs. Our techniques for overcoming these challenges are the technical contributions of this paper. We evaluate WitchDoctor's design and implementation by simulating over 5,000 refactoring operations across three open-source projects. The simulated user is faster and more efficient than an average human user, yet WitchDoctor can detect more than 90% of refactoring operations as they are being performed -- and can complete over a third of refactorings before the simulated user does. All the while, WitchDoctor remains robust in the face of non-parseable programs and unpredictable refactoring scenarios. We also show that WitchDoctor is efficient enough to perform computation on a keystroke-by-keystroke basis, adding an average overhead of only 15 milliseconds per keystroke.

References

[1]
E. Murphy-Hill, C. Parnin, and A. P. Black, "How we refactor, and how we know it," in Proceedings of the 31st International Conference on Software Engineering, ser. ICSE '09. Washington, DC, USA: IEEE Computer Society, 2009, pp. 287-297. {Online}. Available: http://dx.doi.org/10.1109/ICSE.2009.5070529
[2]
E. Murphy-Hill and A. P. Black, "High velocity refactorings in eclipse," in Proceedings of the 2007 OOPSLA workshop on eclipse technology eXchange, ser. eclipse '07. New York, NY, USA: ACM, 2007, pp. 1-5. {Online}. Available: http://doi.acm.org/10.1145/1328279.1328280
[3]
E. W. Myers, "An o(nd) difference algorithm and its variations," Algorithmica, vol. 1, pp. 251-266, 1986.
[4]
C. L. Forgy, "Expert systems," P. G. Raeth, Ed. Los Alamitos, CA, USA: IEEE Computer Society Press, 1990, ch. Rete: a fast algorithm for the many pattern/many object pattern match problem, pp. 324-341. {Online}. Available: http://dl.acm.org/citation.cfm?id=115710.115736
[5]
M. Kim, M. Gee, A. Loh, and N. Rachatasumrit, "Ref-finder: a refactoring reconstruction tool based on logic query templates," in Proceedings of the eighteenth ACM SIGSOFT international symposium on Foundations of software engineering, ser. FSE '10. New York, NY, USA: ACM, 2010, pp. 371-372. {Online}. Available: http://doi.acm.org/10.1145/1882291.1882353
[6]
W. F. Opdyke and R. E. Johnson, "Refactoring: An aid in designing application frameworks and evolving object-oriented systems," in Symposium on Object-Oriented Programming Emphasizing Practical Applications (SOOPPA), September 1990.
[7]
W. G. Griswold, "Program restructuring as an aid to software maintenance," Ph.D. dissertation, 1991.
[8]
E. Murphy-hill, "Improving refactoring with alternate program views. research proficiency exam," 2006.
[9]
E. Murphy-Hill and A. P. Black, "Breaking the barriers to successful refactoring: observations and tools for extract method," in Proceedings of the 30th international conference on Software engineering, ser. ICSE '08. New York, NY, USA: ACM, 2008, pp. 421-430. {Online}. Available: http://doi.acm.org/10.1145/1368088.1368146
[10]
E. Murphy-Hill, A. P. Black, D. Dig, and C. Parnin, "Gathering refactoring data: a comparison of four methods," in Proceedings of the 2nd Workshop on Refactoring Tools, ser. WRT '08. New York, NY, USA: ACM, 2008, pp. 7:1-7:5. {Online}. Available: http://doi.acm.org/10.1145/1636642.1636649
[11]
E. Murphy-Hill, "Improving usability of refactoring tools," in Companion to the 21st ACM SIGPLAN symposium on Object-oriented programming systems, languages, and applications, ser. OOPSLA '06. New York, NY, USA: ACM, 2006, pp. 746-747. {Online}. Available: http://doi.acm.org/10.1145/1176617.1176705
[12]
M. Fowler, Refactoring: Improving the Design of Existing Code. Boston, MA, USA: Addison-Wesley Longman Publishing Co., Inc., 1999.
[13]
E. van Emden and L. Moonen, "Java quality assurance by detecting code smells," in Reverse Engineering, 2002. Proceedings. Ninth Working Conference on, 2002, pp. 97- 106.
[14]
R. Marinescu, "Detection strategies: Metrics-based rules for detecting design flaws," in In Proc. IEEE International Conference on Software Maintenance, 2004.
[15]
M. J. Munro, "Product metrics for automatic identification of "bad smell" design problems in java source-code," in Proceedings of the 11th IEEE International Software Metrics Symposium. Washington, DC, USA: IEEE Computer Society, 2005, pp. 15-. {Online}. Available: http://dl.acm.org/citation.cfm?id=1090955.1092155
[16]
N. Moha, Y.-G. Guhneuc, L. Duchien, and A.-F. L. Meur, "Decor: A method for the specification and detection of code and design smells." IEEE Trans. Software Eng., pp. 20-36, 2010.
[17]
I. M. Bertran, "Detecting architecturally-relevant code smells in evolving software systems," in Proceeding of the 33rd international conference on Software engineering, ser. ICSE '11. New York, NY, USA: ACM, 2011, pp. 1090-1093. {Online}. Available: http://doi.acm.org/10.1145/1985793.1986003
[18]
D. Dig, C. Comertoglu, D. Marinov, and R. E. Johnson, "Automated detection of refactorings in evolving components," in ECOOP, 2006, pp. 404-428.
[19]
Z. Xing and E. Stroulia, "Api-evolution support with diff-catchup," IEEE Trans. Softw. Eng., vol. 33, pp. 818-836, December 2007. {Online}. Available: http://dl.acm.org/citation.cfm?id=1314032.1314041
[20]
W. Wu, Y.-G. Guéhéneuc, G. Antoniol, and M. Kim, "Aura: a hybrid approach to identify framework evolution," in Proceedings of the 32nd ACM/IEEE International Conference on Software Engineering - Volume 1, ser. ICSE '10. New York, NY, USA: ACM, 2010, pp. 325-334. {Online}. Available: http://doi.acm.org/10.1145/1806799.1806848
[21]
K. Prete, N. Rachatasumrit, N. Sudan, and M. Kim, "Template-based reconstruction of complex refactorings," in Software Maintenance (ICSM), 2010 IEEE International Conference on, sept. 2010, pp. 1 -10.
[22]
Z. Xing and E. Stroulia, "Umldiff: an algorithm for object-oriented design differencing," in Proceedings of the 20th IEEE/ACM international Conference on Automated software engineering, ser. ASE '05. New York, NY, USA: ACM, 2005, pp. 54-65. {Online}. Available: http://doi.acm.org/10.1145/1101908.1101919
[23]
B. Fluri, M. Wursch, M. Pinzger, and H. Gall, "Change distilling: tree differencing for fine-grained source code change extraction," Software Engineering, IEEE Transactions on, vol. 33, no. 11, pp. 725-743, nov. 2007.

Cited By

View all
  • (2023)Structural-semantics Guided Program Simplification for Understanding Neural Code Intelligence ModelsProceedings of the 14th Asia-Pacific Symposium on Internetware10.1145/3609437.3609438(1-11)Online publication date: 4-Aug-2023
  • (2022)Analyzing model changes with LoupeProceedings of the 25th International Conference on Model Driven Engineering Languages and Systems: Companion Proceedings10.1145/3550356.3561564(519-528)Online publication date: 23-Oct-2022
  • (2022)Impact of change granularity in refactoring detectionProceedings of the 30th IEEE/ACM International Conference on Program Comprehension10.1145/3524610.3528386(565-569)Online publication date: 16-May-2022
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ICSE '12: Proceedings of the 34th International Conference on Software Engineering
June 2012
1657 pages
ISBN:9781467310673

Sponsors

Publisher

IEEE Press

Publication History

Published: 02 June 2012

Check for updates

Qualifiers

  • Article

Conference

ICSE '12
Sponsor:

Acceptance Rates

Overall Acceptance Rate 276 of 1,856 submissions, 15%

Upcoming Conference

ICSE 2025

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)1
  • Downloads (Last 6 weeks)0
Reflects downloads up to 30 Aug 2024

Other Metrics

Citations

Cited By

View all
  • (2023)Structural-semantics Guided Program Simplification for Understanding Neural Code Intelligence ModelsProceedings of the 14th Asia-Pacific Symposium on Internetware10.1145/3609437.3609438(1-11)Online publication date: 4-Aug-2023
  • (2022)Analyzing model changes with LoupeProceedings of the 25th International Conference on Model Driven Engineering Languages and Systems: Companion Proceedings10.1145/3550356.3561564(519-528)Online publication date: 23-Oct-2022
  • (2022)Impact of change granularity in refactoring detectionProceedings of the 30th IEEE/ACM International Conference on Program Comprehension10.1145/3524610.3528386(565-569)Online publication date: 16-May-2022
  • (2022)Green AIProceedings of the 44th International Conference on Software Engineering10.1145/3510003.3510221(1082-1094)Online publication date: 21-May-2022
  • (2019)On the fly synthesis of edit suggestionsProceedings of the ACM on Programming Languages10.1145/33605693:OOPSLA(1-29)Online publication date: 10-Oct-2019
  • (2019)AutoFritzProceedings of the 2019 CHI Conference on Human Factors in Computing Systems10.1145/3290605.3300633(1-13)Online publication date: 2-May-2019
  • (2019)Semantic source code models using identifier embeddingsProceedings of the 16th International Conference on Mining Software Repositories10.1109/MSR.2019.00015(29-33)Online publication date: 26-May-2019
  • (2019)On the customization of batch refactoringProceedings of the 3rd International Workshop on Refactoring10.1109/IWoR.2019.00010(13-16)Online publication date: 28-May-2019
  • (2019)Graph-based mining of in-the-wild, fine-grained, semantic code change patternsProceedings of the 41st International Conference on Software Engineering10.1109/ICSE.2019.00089(819-830)Online publication date: 25-May-2019
  • (2019)Do developers discover new tools on the toilet?Proceedings of the 41st International Conference on Software Engineering10.1109/ICSE.2019.00059(465-475)Online publication date: 25-May-2019
  • Show More Cited By

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media