user269723
user269723

Reputation: 79

java tool for debugging

Currently we are studying the Java based tool which is primarily Reporting tool.It was developed in 2000/2001 period and uses many open source libraries like Apache Avalon/Mx4J.Adaptor/edu.Oswego(java concurrent package) etc. Tool uses jdk 1.3.1 and goal is to upgrade to jdk 1.5.We have also been asked to remove these 'outdated' packages and replace by standard Java packages if possible.

Unfortunately we have the code available for study but lacks any documentation and really difficult to track the flow(Total number of classes written might be more than 1000) during debugging.

Whats the best way to understand this kind of tool? Any graphical tool to see the relationship between the classes?

Thanks, SR

Upvotes: 0

Views: 261

Answers (5)

Naveed Kamran
Naveed Kamran

Reputation: 169

You can do it easily in NetBeans.

Select the method signature and press ALT+F7 (or alternately right click and then click "Find Usages") this would show you from where a particular method is being called.

Second option is little hectic but may give some results. Configure log4j for your project and try to give the proper logging code in each method.

Upvotes: 0

Lucas T
Lucas T

Reputation: 3217

Any graphical tool to see the relationship between the classes?

If you want to see the relationship between classes you could try Green UML . It creates a nice UML class diagram out of your repository. It works on Eclipse. I hope that helps.

Upvotes: 0

Bozho
Bozho

Reputation: 596996

Eclipse (and newer version of NetBeans and perhaps IntelliJ) have wonderful tools for analyzing large codebases:

  • Call hierarchy (CTRL + ALT + H) - you see the hierarchies of calls to/from a given method
  • Type hierarcy (F4) - you see the whole inheritance structure
  • Data hierarchy
  • Right click on item > References
  • many different search options

Upvotes: 0

sleske
sleske

Reputation: 83577

That's a common problem (unfortunately), and again unfortunately there is no easy solution.

There are many tools to help you (see below), but these are only helpers, they will not solve the problem for you.

I have found that a systematic approach is best. There is a good article on this:

Swallowing an elephant in 10 easy steps , about understanding a large, undocumented system. It's about Perl, but the ideas are independent of language.

Some tools that might help:

  • Step through interesting parts in a debugger (e.g. Eclipses debugger)
  • Use Eclipse's "Call hierarchy" and "find references" to understand which part of the code uses what
  • Run tests with simple input data, understand what they produce
  • Write javadocs into the code documenting what you found, possibly correcting existing docs
  • Use tools to visualize class dependencies. I have unsed JDepend with some success; there are many others.

Upvotes: 1

John
John

Reputation: 6785

You could try some of the Source Code Analyzer plugins to eclipse. Tools like DIVER or X-Ray might be useful.

Upvotes: 1

Related Questions