aspose file tools*
The moose likes Java in General and the fly likes how do you familiarize with huge codebase relatively quickly? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "how do you familiarize with huge codebase relatively quickly?" Watch "how do you familiarize with huge codebase relatively quickly?" New topic
Author

how do you familiarize with huge codebase relatively quickly?

Pavan Kumar
Ranch Hand

Joined: Jan 23, 2004
Posts: 78
Friends,

I was just wondering if there is a better way to get yourself familirize with a new project with huge code base, lot of abstractions, other than reading code as we go.

any thoughts? suggestions?

Thnaks,


formerly known as Cnu
Manuel Moons
Ranch Hand

Joined: Mar 05, 2002
Posts: 229
If you have to dig in yourself this is going to be pretty hard. If the person (s) who wrote the code are around you should ask them to show you the basic concepts in the code.

You cannot expect to know the code inside out in a couple of days. If you work on the code for a while you will start to understand it better. Time is of the essence here.
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
What does the Javadoc look like?


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Francis Shillitoe
Greenhorn

Joined: Aug 30, 2002
Posts: 22
As you read and understand the code as you go, javadoc it, to make it easier for the next person. You can use UML class diagrams to show the class abstractions you describe. UML sequence diagrams are also very useful to show various runtime scenarios. There are tools which can automatically reverse engineer code into models such as TogetherJ and Ration Rose XDE.

Francis


<a href="http://www.shillitoe.com" target="_blank" rel="nofollow">http://www.shillitoe.com</a>
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Yes, round-trip engineering tools can help by making diagrams, although for any non-trivial codebase the truth is that these often look like mush, too.

Having a good IDE is invaluable in understanding code. Don't try to read the code in Notepad, or in printouts. Use an IDE with good navigation features so that you can click on a method or class name and instantly go to its definition and find all of its usages. Use an IDE with advanced-enough syntax highlighting that it can display arguments and local, member, and static variables all as different colors (Eclipse 3, IntelliJ IDEA), because this will save you lots of time.

If there are tests, look at the tests! If you're lucky enough to be learning a codebase that was developed using a TDD methodology, then the unit tests should provide excellent examples of how each class is intended to be used: they're better than any manual could be.


[Jess in Action][AskingGoodQuestions]
Pavan Kumar
Ranch Hand

Joined: Jan 23, 2004
Posts: 78
Thanks very much for your time and valuable inputs,

I have been using Eclipse and it is of great help indeed. Some methods are documented, but most of the time I come across DOCUMENTME tag.
I think it's a good idea to document when I know what a method is doing, not spending too much time ofcouse.

I haven't tried the round trip tools yet, i will certainly look into this option.
Speaking to the developers is a good idea, I'll certainly do this more to gain enough knowledge on the APIs.

There are not many test cases written, but I think it's certainly better with the IDE.

your inputs are very much appreciated.
Thanks,
CNU
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how do you familiarize with huge codebase relatively quickly?