IBM has released a preview of a new free tool called Structural Analysis for Java (SA4J). The tools aims to automatically detect and pinpoint architectural weaknesses. This tool is a collaboration between the expertise of Rational with IBM's testing and analysis know-how. It uses algorithms to hunt out antipatterns.
- Posted by: Dion Almaer
- Posted on: March 01 2004 10:32 EST
"SA4J provides mathematically proven ways of determining the quality of the architecture, and this assessment can be used as a basis for deciding whether to reuse or modify existing Java code. If code is marked as unstable, even the smallest change in the architecture can result in unexpected delays in development as well as potentially more defects."
IBM looks to boost Java apps analysis
IBM releases new Java structure analysis tool
Structural Analysis for Java Home Page
- What happened to SmallWorlds? by Alok Singh on March 01 2004 14:57 EST
- In other news... by Jim LoVerde on March 01 2004 15:01 EST
- IBM releases new Java structure analysis tool by Erik Bengtson on March 01 2004 15:11 EST
- IBM releases new Java structure analysis tool by scot mcphee on March 01 2004 15:34 EST
- Great Tool... and a small Java shortfall by Nikolay Botev on March 02 2004 06:07 EST
- Not very stable by Charles Zhao on March 02 2004 13:06 EST
- Re: Not very stable by Jan Koops on March 03 2004 01:57 EST
- Not very stable by Mark N on March 03 2004 23:18 EST
- An efficiency measurement tool that crashes! Wow. by Venkatesh Addanki on March 04 2004 09:15 EST
- Use DependencyFinder and read Robert Martin by Scott Stirling on March 02 2004 14:08 EST
Is this tool from the SmallWorlds codebase? After IBM bought the company, I haven't heard anything about the SmallWorlds product suite? As a former user, I think SmallWorlds was one the best graphical code analysis tools ever.
Architectural flaw detected: You are using Entity Beans!
After reading the BIOs of the software authors, one could presume that this is the follow-on to SmallWorlds after IBM bought it.
I guess it is Smallworlds, UI hasn't changed at all. Seems to be faster than the previous version. Still need to see how it performs with a larger code base. But, glad to see it availble again.
IBM develops internal version of JDepend, packages it with a windows only installation tool, and releases it with accompanying fanfare and marketecture.
Oh wait, sorry for the duplicate posting. ;)
(On the plus side, hopefully this gets more people thinking about the importance of minimizing dependencies as it relates to future enhancements and maintenance. In a word: "architecture".)
just tested it. it's a tool that will help a lot on redesigning apps.
Anyone care to share their thoughts on this tool versus Jdepend and Pasta/Optimal Advisor? I really like Optimal Advisor but we could never get it to work under AIX as it seemed to be reliant on Sun.* classes that don't exist on IBM's AIX JDK.
Is this to compete with Wily and JProbe? Is the most common error message, you are using Websphere, run:) This looks interesting, as I have to use websphere a lot.
I have been trying to sell a project to rewrite a very poorly designed component of one of our clients' Enterprise Apps.
Now I can actually show my boss that this particular component has a stability rating of 62% according to SA4J, compared to 96% of the entire system.
And, now on the other end... I have been playing with it for a while, and I noticed something - this system cannot account for all relationships between object - in particular, it cannot weigh the dependency on constants: in the above system there are several instances of classes containing a large number of constants used throughout the application.
Due to the fact that Java resolves constants during compile time and does not store constant reference info in the .class files, the only thing that SA4J shows is that package A uses package B (i.e. a class in package A references a constant from a class in package B - I am guessing that the Java stores info about the "import B.*" declaration in the .class file).
...Anyway, I think this is a great tool, and luckily tiger comes right on time to save us from having to resort to poor practices like that with the introduction of enums. So that instead of writing (C/C++ style, in our case derived from a Win32 API practice):
we can do
and even distribute those enums into different packages (where they would most naturally belong).
I know somebody might say we could have done the same thing with two classes, but the fact of the matter is this was not really the accepted practice so far, at least if you adhere the practices the core J2SDK APIs - just look at the Calendar class for an example...
It crashes on a 40M ear file.
I had to raise the heap to 768M and correct the W32-batch-file (Wrong main class stated in there) to get it our project analyzed (15k classes). For large code-bases you may also have a look at the Sotograph (www.sotograph.de), which simply fills a database with the metadata of your classes. You can then run your own or predefines queries on this db.
It crashes on a 40M ear file.
Maybe that it crashed on your app is analysis enough? :)
40Mb? Wow. What you got in there?
40Mb is not that big. Considering you'll have all the libraries used, all the wars , etc. 100Mb still wouldn't be that big. Think about all the images in just one war.
Wonder if they ran the tool on itslef first to see how efficient it is before using on other's applications.
In fact yes. :) Interesting comments... It's always good to hear different opinions. The more constructive the better. ;-)
A free tool that has all the salient features that SA4J does is DependencyFinder: http://depfind.sourceforge.net/. JDepend is similar, but not as accurate in dependency analysis, and doesn't have a GUI or a flexible suite of tools like DependencyFinder. Pasta (http://javacentral.compuware.com/pasta/), a free tool from Compuware, is similar and provides some refactoring support (that you'd probably never want to use), but the output graphs are nice looking. These all report on the same metrics that Robert Martin devised, and have varying degrees of finesses in displaying and reporting on the dependencies in your code. In my experience, DependencyFinder is by far the best.
Tools like this have been around for years for C++ and Java. Package dependency analysis and metrics based on packages' directional relationships and contents of abstract classes, interfaces, and concrete classes goes back to Robert Martin's 1996 "C++ Report" articles: http://www.objectmentor.com/resources/listArticles?key=date&date=1996. All rehashed in his recent "Agile Software Development: Principles, Patterns and Practices" book.