How to create a data flow diagram for Java source code

I wrote an application with approximately 500 classes in java.Now I know that it has been set many times here, but I still could not find a suitable resource or tutorial to create a data flow diagram for my entire project.

Any help / tutorial / resource or sample code is welcome.

+4
source share
3 answers

You may be able to get data streams from your unit tests. If you have instance A and mock B , and you expect instance C be passed as prameter to B.bar(Object) when you call A.foo(C) . In such cases, you get a stream of data from one object to another.

The second task is to check the configuration of the application. If you find that instance D configured with instance E , which itself is configured with instance F , you can combine the streams of data that you received from your unit tests.

But I do not know any implementation for this. But both parts seem relatively easy to implement. In the first part, you need to connect to your mocking structure. The second part is simple if you use dependency injection.

EDIT:
If you have collected all this data, you can, for example, use the Eclipse UML API to create diagrams.

+1
source

Here is another attempt to use Eclipse:

MoDisco can create an emf model for your Java project. This emf model will be the basis for creating data flow diagrams. With ATL, you can transform this model into a suitable model for visualization. For visualization, you can select the UML activity diagram. This has the advantage of being able to work with existing UML technologies. Another possibility is to use Zest or GraphML and yEd to create a visualization.

+1
source

Grab the full version of IntelliJ's idea - it has data flow diagrams and other nice analysis tools. You will receive a 30-day sports license so you can see that this is the option for you.

0
source

Source: https://habr.com/ru/post/1437963/


All Articles