About reverse engineering code to the UML

If you develop projects in Microsoft Visual C++, Microsoft Visual Basic, or Microsoft Visual C#, Visual Studio .NET offers an integrated software modeling solution using Microsoft Office Visio. From within Visual Studio, you can reverse engineer your source code into the Unified Modeling Language (UML); your project's class definitions are used to generate a UML diagram in the Visio environment.

For example, you may have inherited a legacy solution that was developed using Visual Basic or Visual C++. To better understand the structure of the solution, you can open it in Visual Studio .NET and then automatically extract its structures for viewing as elements in a UML static structure diagram. Or, you may have written a new project in Visual C# (or Visual Basic or Visual C++) and want to view its classes as graphical objects. Using the class definitions in your project, reverse engineering allows you to view the design model for your new project.

Reverse engineer a project or an entire solution

You can reverse engineer an entire solution or a selected project within a solution. The selections you make in the Visual Studio Solution Explorer determine what is reverse engineered to the Visio UML.

Note: Be sure to build the solution in Visual Studio before reverse engineering to help resolve cross-project references.

Initiating reverse engineering in Visual Studio

In the Visual Studio environment, reverse engineering is activated from a command on the Project menu. Information from the code model is extracted, Visio is launched, and reverse-engineered elements of your code appear as icons in the tree view of the Visio UML Model Explorer. You can then drag UML class shapes that reflect class definitions in the source code onto a drawing page to visualize the architecture of the new or legacy solution.

During a reverse engineering operation, status information about the operation is written to the Visual Studio Output window.

Launching existing Visio files from within Visual Studio

When a project tree view has been reverse engineered, the Visio drawing is added to the solution under Solution Items. Double-clicking the Visio diagram will cause Visio to launch and open the selected file.

Expand your Office skills
Explore training
Get new features first
Join Office Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.