Military Embedded Systems

Code analysis tool zooms like Google Earth when analyzing millions of lines of code


March 30, 2012

John McHale

Editorial Director

Military Embedded Systems

SAN JOSE, Calif. Engineers at GrammaTech announced a new tool this week that actually makes code analysis fun. Seriously, their new tool -- which works with their CodeSonar static analysis tool ? functions much like Google Earth, but instead of zooming in on your neighbor?s house you?re zooming down to view individual lines of code in systems that contain as much as 20 million lines of code. They released it this week at the Design West conference in San Jose, Calif.

The CodeSonar visualization tool enables developers to visualize massive data sets to work at different levels of abstraction, says Paul Anderson, vice president of engineering for GrammaTech. It was designed for a customer program that contained 20 millions lines of code, but there’s no reason to think the tool cannot analyze even larger amounts of code, he says. Users can also overlay the CodeSonar defect analysis capability, Anderson adds.

GrammaTech designers originally based the tool on Google Earth, but found that model inefficient and then created their own visualization tool that still has the same “zooming” effect that you see with Google Earth, Anderson explains.

Users can actually scroll via the mouse all the way out so that the program is just a dot, like the universe Big Bang theory then shoot all the way down to individual lines of code.

“Typically, text editors show just a few dozen lines of code at a time. Currently available visualization tools are effective at displaying small-scale parts of the program structure such as fragments of class hierarchies and subsets of the call graph, but it is infeasible to use those tools to show whole-program structures. Even for small projects, such tools become unusable because of complexity and performance,” Anderson says. “CodeSonar’s new program-visualization capability was specifically designed to perform well on millions of lines of code. It presents data in a layered fashion, so users can choose to see only the information appropriate to the desired level of abstraction. Users can explore the program in a top-down fashion, starting with the outermost high-level modules and zooming in to reveal detail at a finer granularity; or can take a bottom-up approach if that is more appropriate to the task.”

According to a GrammaTech release the CodeSonar visualization displays the program’s call graph so it is organized according to the program module structure. Graph layouts can be changed in real time and present data in tree, circuit, map, cluster, radial, flow, and other layouts. Data is displayed in a layered way that provides a high-level view with drill-down capability and users can explore the program from the bottom up too. With CodeSonar visualization, developers can begin at individual functions to gain insight from a bottom-up perspective, annotate nodes and edges with additional information and overlay the visualization with data on defects and source-code metrics such as complexity.

Other features include the ability of users to search the graph for functions of interest, navigate to and from the source code of the program, and view the graph in different layouts. In addition, the architecture is extensible, so users can generate graphs from other sources, feed them in an XML format to the tool and see them in the same user interface.

CodeSonar visualization runs through a standard web client such as Microsoft Internet Explorer, Chrome, or Firefox browsers. An early release version is available to customers now. For more information on the CodeSonar visualization tool GrammaTech would prefer phone inquiries at 607-273-7340.


Featured Companies


6903 Rockledge Drive, Suite 820
Bethesda, MD 20817
Comms - Communications
Topic Tags