Automated testing of refactoring engines
Author(s) -
Brett Daniel,
Danny Dig,
Kely Garcia,
Darko Marinov
Publication year - 2007
Publication title -
illinois digital environment for access to learning and scholarship (university of illinois at urbana-champaign)
Language(s) - English
Resource type - Conference proceedings
DOI - 10.1145/1287624.1287651
Subject(s) - code refactoring , computer science , programming language , key (lock) , component (thermodynamics) , program transformation , transformation (genetics) , software engineering , code (set theory) , source code , software , operating system , biochemistry , chemistry , set (abstract data type) , gene , thermodynamics , physics
Refactorings are behavior-preserving program transformations that improve the design of a program. Refactoring engines are tools that automate the application of refactorings: first the user chooses a refactoring to apply, then the engine checks if the transformation is safe, and if so, transforms the program. Refactoring engines are a key component of modern IDEs, and programmers rely on them to perform refactorings. A bug in the refactoring engine can have severe consequences as it can erroneously change large bodies of source code. We present a technique for automated testing of refactoring engines. Test inputs for refactoring engines are programs. The core of our technique is a framework for iterative generation of structurally complex test inputs. We instantiate the framework to generate abstract syntax trees that represent Java programs. We also create several kinds of oracles to automatically check that the refactoring engine transformed the generated program correctly. We have applied our technique to testing Eclipse and NetBeans, two popular open-source IDEs for Java, and we have exposed 21 new bugs in Eclipse and 24 new bugs in NetBeans.
Accelerating Research
Robert Robinson Avenue,
Oxford Science Park, Oxford
OX4 4GP, United Kingdom
Address
John Eccles HouseRobert Robinson Avenue,
Oxford Science Park, Oxford
OX4 4GP, United Kingdom