Developers usually do their diagramming in the design phase. After code is written, it's unlikely that any diagramming will ever take place, even though it could be useful for code maintenance. Why? If programmers have little time to create class diagrams and the like in the design phase, there's scant hope that time pressures will ease enough for them build class diagrams when the code is in source control.
Logic Explorers's CodeLogic could change that. CodeLogic is a post-hoc diagramming tool, suitable either for reverse-engineering unfamiliar code or documenting familiar code.
CodeLogic builds diagrams by parsing source code. Hence, its graphs and charts are objectively accurate. A lead developer could use CodeLogic to verify that code has properly implemented both the static architecture and dynamic behavior defined in the project's functional specification.
CodeLogic produces three kinds of diagrams: class, sequence, and flow. CodeLogic's class and sequence diagrams are UML-standard; its flow diagrams are similar to typical execution flowcharts, with some additional capabilities.
All three diagrams are interactive in one fashion or another. For example, clicking on the box of a class or interface in the class diagram toggles the box opened or closed, revealing or hiding the class's details. This feature is handy if you're working with a complex class structure and need to manage screen space.
The sequence diagram presents the transactions that occur between objects as a method executes. It lets you hide and reveal object instances so you can filter out extraneous complexity.
CodeLogic's flow diagram is easy to read if you're familiar with classic flowcharts. For example, actual lines of source code are displayed adjacent to arrow icons. Clicking on an arrow icon transports you to the associated location in the source code. Right-click on a method call and a pop-up facilitates a jump to that other method in its own flow diagram. However, I found no easy way to jump back to the caller.
Perhaps the flow diagram's most useful capability is variable tracking. Select a variable from a line of code in the diagram, and CodeLogic traces the data flow of the variable from the point at which it is first defined to the current location.
At any line of code in which the variable may have been altered, CodeLogic attaches a highlighted rectangle filled with the names of the variables that may have contributed to the changed value of the target. You can select multiple variables to track; CodeLogic will add the new lines of flow to the current diagram. In short, you have a diagram that shows all the locations in a method where the value of a target variable has been created, modified, or in any way influenced. This information is invaluable if you're trying to figure out how a variable was set to a particular value.
You can run CodeLogic either stand-alone or integrated with one of a number of IDEs, including Eclipse and Visual Studio. If you run the stand-alone Java version, you simply select a folder and CodeLogic treats it as the project container. The .Net stand-alone version operates similarly. (As of this writing, the variable tracking did not function in the C# version, but Logic Explorers says the feature will be working in the official 2.0 release.)
CodeLogic is a useful, uncomplicated tool. In its stand-alone form, it's a good way to pry into unfamiliar code. As a plug-in, it's extremely useful for backtracking a variable's flow through complicated methods. In either case, it quickly creates UML diagrams that software quality auditors will happily attach to their specifications.