Reverse Engineering Source Code to Model and Diagrams

The Reverse Engineering tool helps you create new diagrams for the projects with existing source codes in no time. You can select the projects, folders, or files to generate UML class diagrams, package diagrams, and entity-relation diagrams. The tool allows you to create new diagrams or updated diagrams that were already created by a source code.

Code to UML

Source code can be transformed into UML diagrams using reverse engineering tools in Software Ideas Modeler. Classes from various supported programming languages can be turned into UML class diagrams where the class elements are connected with appropriate relationships (such as generalization, association, etc.). The UML generator can also produce package diagrams based on packages and namespaces defined in the source code files. The code to UML transformation supports new diagram creation as well as update of existing diagrams.

Code to ERD

The reverse engineering feature includes entity-relationship diagram generation. The classes in the source code can be turned into ERD entities. During code to ERD transformation, unsupported items will be omitted, e.g. operations that are not supported by the ERD notation.

How to Create Diagrams from Code

The reverse engineering feature is available in:

  • Ribbon / Process tab / Reverse Engineering group / Source Code
  • Menu / Tools / Reverse Engineering / Source Code
Reverse Engineering / Source Code
Reverse Engineering / Source Code

The action will open the Source Code Import dialog that helps you to reverse engineer your source code into a diagram or a set of diagrams. The dialog offers two tabs: General and Settings.

General Tab

In the General tab, you can choose a programming language (C#, C++, Dart, Java, JavaScript, Object Pascal, PHP, Python, Ruby, SQL DDL, Visual Basic) that is used in the source code you want to process. The tab offers various options on how to choose the source code files. You can import the files by a project file (only for some programming languages). The other options are available for all programming languages - you can add individual files with the source code using the Add Files button or add all the files from a chosen folder using the Add Directory button.

The three other buttons Select All, None, and Invert allow you to adjust which files from the list you want to process. This way, you can load all files from a project to the list but choose only some of them to import into the model.

Reverse Engineering Settings

The Settings tab offers other options which are essential in adjusting the output of reverse engineering.

Source Code Import - Settings tab
Source Code Import - Settings tab

The Objects group allows you to choose which types of entities you want to import. You can pick from several entity types:

  • Classes - to generate UML class diagrams from code
  • Packages - to generate UML package diagrams from code
  • ERD entities - to generate ERD diagrams.

The group Diagramming includes settings for the diagram output configuration. If the option 'Add new elements to diagram' is checked, the new elements will be added to a new diagram. Otherwise, only the models will be imported. (You can manually insert the elements into your diagrams later.)

You can choose a target folder for the new diagrams. Click on the button with the ellipsis to select the folder from the project tree.

The option 'Create hierarchy by namespace' activates the automatic creation of subfolders by the namespaces/packages in the source project.

In the Model group, you can configure how to process the changes in the project model. There are the following options:

  • Update existing elements - if the elements were already imported, their model will be updated according to the changes in the source project. If this option is unchecked, the new version of the element will be imported as a separate element.
  • Delete missing elements - if the element that was already imported is not present in the source project anymore, it will be removed during the processing.

Repository for model elements - allows you to choose a project repository (project, folder, diagram), in which will be the new elements imported.

  • Default repository - the target folder for the diagram will be used as the model repository. If it is not defined, the first folder in the project will be used instead.
  • Custom repository - you can click on the ellipsis button to choose the repository in the project tree.

After clicking on the OK button, reverse engineering will process the source project by the settings (the new elements will be added to the model, some elements can be updated, the new diagrams can be created). You can also undo the action later.

Comments

Balbir Singh 3 August 2022 14:44:55

Failing to open 'Source Code' dialogue

Hi,

I installed your product for a trial version.

Looking to reverse engineer the existing application in "C++" & "C#".

But on clicking the - 'Source Code' button - No action takes place for opening the- "the Source Code Import dialog box". Same issue with other buttons in the "Reverse Engineering" section.

Please suggest!

Thanks!

Dusan Rodina - softwareideas.net 4 August 2022 11:02:27

RE: Failing to open 'Source Code' dialogue

Hi,

That is unexpected behavior. Unfortunately, we could not reproduce the issue on Windows 10, Windows 11, or Windows Server. Could you please provide us with more details? What operating system are you using? Did an error message show? If you try the Portable edition, does it still not work for you?

Portable edition:

https://www.softwareideas.net/Download/3558/software-ideas-modeler-13-60-32-bit-portable-

Samar 2 November 2022 21:54:41

the meaning of underline

I use this tool, using python as source code and try to convert it to class diagram. but I found underline in some attributes what this underline meaning?

Dusan Rodina - softwareideas.net 4 November 2022 15:28:55

RE: the meaning of underline

The undeline style is used for static attributes or class-defined fields in Python.

Nithin Kalyan 17 May 2023 15:45:41

Software

Hi, I have installed the new version i.e Version 13 of Software Ideas Modeler, to generate other diagrams like sequence and activity diagrams from source code, what is the process? Please answer my query as soon as possible as i have a project on this topic this saturday

Dusan Rodina - softwareideas.net 17 May 2023 16:15:05

RE: Software

Hi,

The software supports only class diagram and package diagram generation from source code. The other diagrams can be composed only manually.

Diego 21 July 2023 10:25:05

Can't use reverse engineering.

Hi, I'm trying the free version (13.99) and I can't find the option of "parser" nor "reverse engineering from source code".

Dusan Rodina - softwareideas.net 21 July 2023 10:32:13

RE: Can't use reverse engineering.

Hi, the free version (Standard edition) does not include these features. You can find the complete comparison of editions here: https://www.softwareideas.net/en/edition-comparison

Tara 10 October 2023 20:49:13

Missing multiple features on paid version

Hi. I bought this software to help generate class diagrams from C# .NET code. However none of the features are active even though they were included in the package I purchased. I have the premium package.

Dusan Rodina - softwareideas.net 10 October 2023 21:51:05

RE: Missing multiple features on paid version

Hi,

The features you're looking for should be available.

When you launch the software, choose "Create Project from Code..." from the menu on the right side of the Start Page.

Alternatively, you can use one of the following methods:

Press CTRL+Q, type "Source Code", and then select Process -> Reverse Engineering -> Source Code.

Click on the button labeled "Source Code" in the Process ribbon.

Please note: To utilize either of these two options, you must first create a New Project.

Hope this helps!

william 14 October 2023 23:44:40

Reverse-engineering from open api specification

I wanted to use the reverse engineering function to draw a class diagram from an open api specification. But the source code tab doesn't propose yaml, or even json as source code. And the resulting diagram is not really satisfying

Dusan Rodina - softwareideas.net 16 October 2023 8:33:34

RE: Reverse-engineering from open api specification

Hello,

You need to use a dedicated tool for OpenAPI specification processing - the tutorial is available here: https://www.softwareideas.net/generate-open-api-diagram

Bart 22 October 2023 12:07:03

Typescript tsx

Dear,

How do I include tsx files while reverse engineering a Typescript/React project?

Thanks,

Bart

Dusan Rodina - softwareideas.net 24 October 2023 13:55:40

RE: Typescript tsx

Hello Bart,

Please follow these steps:

  • Navigate to the "Process" tab on the ribbon, then in the "Reverse Engineering" group click on the "Source Code" button.
  • In the subsequent dialog, select the "TypeScript" language.
  • Click on the "Add Files" button.
  • Within the "Open File" dialog, adjust the file filter to "All Files".
  • Select the desired file. For multiple file selections, hold down the CTRL key while making your choices.

Anonymous 25 October 2023 18:08:26

RE: RE: Typescript tsx

thx!

Zdav 1 February 2024 14:40:33

reverse engineer java source code along with associations

I am using the free edition and I am trying to create a UML diagram from Java source code. The classes are generated but not the associations.

Dusan Rodina - softwareideas.net 1 February 2024 14:51:36

RE: reverse engineer java source code along with associations

Hello,

Are you referring to the free 30-day trial version or the Standard edition? The Standard edition, which is free, does not support diagram generation. Diagram generation through reverse engineering is available in the Premium edition and higher. If you are using a Premium edition or higher, have you updated to the latest version, 14.10? If so, and you're still encountering issues, could you share a portion of the code that isn't working as expected for further analysis?

Zdav 1 February 2024 15:12:47

RE: RE: reverse engineer java source code along with associations

Activated the 30 days evaluation and chose the professional edition. I am getting the same result. Classes are generated but not the associations between them. Is there a sample Java project available that I can test since it's not easy to share my project

Dusan Rodina - softwareideas.net 2 February 2024 15:58:57

RE: RE: RE: reverse engineer java source code along with associations

Could you attempt using some of the available public projects, for example, those found at https://github.com/topics/java-project, and let us know if you encounter similar issues? We aim to better understand and address the situation you've described. Meanwhile, we will also initiate our analysis to further investigate the matter.

New Comment

Comment