Posted by & filed under Documentation, Tips.

When things change from one version of a project to another, sometimes we just want to go back and visually see exactly what those changes were and what they might have affected. Now Understand gives you the power to see how one entity changes over time with the new Compare feature.

Both projects need to be setup with identical paths in the Understand database in order to compare them. The easiest way to do that is to set the projects to Relative mode and put the udb project file in the root of the source tree. Similar to this:

Open the more recent project in Understand. Then go to Tools->Compare->Set Comparison Project and select the project that contains the older version of source code.

Notice that there is a button here to ‘Close Comparison Project’. This button is used to close just this comparison project as it will stay open until it is closed in this menu, or until the first opened project is closed.

After the Comparison Project is set, select ‘OK’ and then it’s time to see the differences. In this project that I’m looking at, I know that I have changed some of the include files in my attributes.cpp file so I will right click on the file name and select ‘Graphical Views->Butterfly Compare’.

The Legend quickly shows the meanings of the different colors and in this sample we can quickly see that there are 2 new references to entities that exist in both versions of the project. We can also see that there are 3 old references and the ‘attributes.cpp’ file is colored in blue because it existed in both versions of the project and it changed from one version to the next.

Note that if the Legend is in the way of what you want to see simply click and drag it to where you want, or right click on the white space of the graph and there is an option to turn the Legend completely off.

Now lets take a look at the function ‘appendTexture’ and see what kind of changes it has from one version to the next.

I can see that there are several changed entities in blue, one old entity that no longer exists in the new version called ‘adjustSize’ which makes all of its references old as well, showing in red. And in green, there are new references and a new entity named ‘changeSize’. I can look into this code further if needed, but a quick look at this graph lets me visualize the changes that have occurred.