Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Java code refactoring

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 334
2
Netbeans IDE Tomcat Server Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author
Posts: 63
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 449
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You would be much easier to understand if you took that bucket off of your head. And that goes for the tiny ad too!
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic