开发者

Are there any tools for detecting architectural and design patterns in code? [closed]

Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and mor开发者_开发百科e. You can edit the question so it can be answered with facts and citations.

Closed 6 years ago.

Improve this question

Our team is doing reverse-engineering on a application with virtually non-existant documentation. We want to detect if there's a use of architectural or design patterns. You may understand that this application is large, so looking manually is no sense for us.

This application is written in Java and we use Eclipse for IDE, so it may be a plugin for Eclipse.

We have found some tools, like "Design Patterns detections Similarity Scoring", but it's not working very well.

So, such tools do exists?


If you have the source code of the app, you are most probably reengineering it, rather than reverse engineering. (The latter means recovering some sort of higher level code from machine- or bytecode).

At any rate, you want to understand the application, i.e. build a mental model of it in your mind. I am afraid automatic tools aren't of much help in this. What use would it be for you to get a list of supposed patterns in the code? Would it help you understand better what the code actually does and why? Especially taking into account the high chances of patterns being misused in legacy code :-(

In the end, you need to get down to reading the code anyway. But here is another similar thread which hopefully helps in the daunting task of taking over a legacy app.


I do not believe these kind of tools exist, because that would be pretty complex. Another approach could be to generate something like an UML diagram. This should give an abstraction of the code which could help you identify the design pattern.


I doubt there are tools out there for detecting patterns or designs in code

Code Bubbles could drastically help the reverse engineering effort, when it eventually comes out !

Lately, am finding it extremely useful to use code coverage tools to identify which parts of the code are called when a particular user/system action is initiated. It's not what the tools were designed for but am increasingly finding it more effective than other approaches. (Can post a link to details here if there is demand for it)

The next best approach is using a tool such as MaintainJ to trace code execution. This link documents that approach (when the author talks about aspects) and various other approaches, and having tried them all, coverage is what I've settled for.


Have you tried running javadoc on the code base? That would give you some idea if the structure (or lack of it) of the code. If you are really lucky design patterns might be mentioned in the comments.

There are lots of other tools for discovering class hierarchy - ClassCycle, Macker, JDepend etc.

Automatic detection of design patterns would be quite difficult I think, because a design pattern carries a lot of scope for variation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜