Refactoring Project

Program-Transformation.Org: The Program Transformation Wiki
Contact

Topics

Progress - Testing - Programs - Documents - Links - Ideas

Progress

Done:

  • Examination of the refactoring tool by Chris Seguin
  • Overview of the AST & the Java Grammer file for JavaCC and JJTree
  • Tree view of the AST of a method from the UI
  • Source view of a method
  • Select statements view of a method (not finished yet)

To do:

  • Check the role and scope of variables
  • Create the parameter list of the method
  • Check if the method should return a value and the type of this value.
  • Create a new method
  • Remove the statements from the parent method

Testing

Maybe we could accept the example refactoring in the refactoring book of Martin Fowler as a test case. We could devide it into several test cases.

Programs

Documents

Links

Ideas

  • Make method extraction possible. Maybe we should extend the grammar for this.
  • You should be able to view the code of a method from the uml view. The pretty printer should be used for this. This feature can be used for code selection in the extract method refactoring.
  • Variable information (currently not supported): references should know what the type of the variable is and where it is defined etc.
  • Editing information: is a variable in a piece of code used for reading or also for writing purposes?

Other ideas which could be used to write a new tool:

  • Create a tool which supports safe refactoring by warning for any possible error which could occure. It should always create correct Java code or it should warn if this isn't possible.
  • Refactorings should be as small and reusable as possible to make it easy to add refactorings.
  • Make a very good parse tree which can be used for many refactorings and other program elements:
    • Checking methods should be included in the parse tree to make them reusable for other refactorings.
    • Methods should know where they are called to make refactorings efficient and easy.
    • Classes should know where they are referenced so they can warn that items when classnames or other classitems change.
  • Try to use code of the Refactoring Tool by Chris Seguin when some problems are solved there in a nice way.