Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java code refactoring

 
pavithra murthy
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 331
2
Java Netbeans IDE Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
T. Sharma
Author
Ranch Hand
Posts: 63
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 449
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also use some static analysis tools like FindBugs, Sonar PMD etc which helps to identify code smells and fixes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic