aspose file tools*
The moose likes OO, Patterns, UML and Refactoring and the fly likes Java code refactoring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Java code refactoring" Watch "Java code refactoring" New topic
Author

Java code refactoring

pavithra murthy
Ranch Hand

Joined: Feb 06, 2009
Posts: 56
Hi all,

I was searching for a java code with have 1000 lines for a refactoring project.
The main goal for this is that I need to identify smells and should be refactored.

Please can anyone provide me your suggestions on how can progress on this?
Joe Areeda
Ranch Hand

Joined: Apr 15, 2011
Posts: 318
    
    2

Refactoring is a pretty general term and can mean a lot of things.

My coding style used to be called Stepwise Refinement and that has morphed into sort of a constant refactoring style. Write something that works and present it to the users with no personal investment. If they don't like it, throw it away, if they do like it bullet proof it.

So assuming you have a program that works the way you want it, the most common reason to refactor would be to make it more maintainable.

My recommendation would be to start by making sure the Javadoc is complete and accurate. This should give you a good idea where the problems are.

I can recommend the book by Martin Fowler "Refactoring: Improving the Design of Existing Code" for some good ideas.

Joe


It's not what your program can do, it's what your users do with the program.
T. Sharma
Author
Ranch Hand

Joined: Jul 30, 2013
Posts: 47
    
    5
pavithra murthy wrote:Hi all,

I was searching for a java code with have 1000 lines for a refactoring project.
The main goal for this is that I need to identify smells and should be refactored.

Please can anyone provide me your suggestions on how can progress on this?


You can use any open source Java code-base along with Infusion (Infusion is the design smell detection tool which is free to use for small projects).

If design smells interest you, then take a look at this post; I hope, you will appreciate it.
Muhammad Khojaye
Ranch Hand

Joined: Apr 12, 2009
Posts: 449

You can also use some static analysis tools like FindBugs, Sonar PMD etc which helps to identify code smells and fixes.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java code refactoring