By Markus Sprunck; Revision: 1.3; Status: final; Last Content Change: Jul 13, 2013;
Static code analysis has been used for many years to find hints concerning errors, design weaknesses and/or compliance to guidelines. With static code analysis you may measure and improve the code quality.
Call-graphs out of pure static code analysis give not in all situations a clear picture of the inner structure of software. This is especially true for software which uses extensive late binding and/or inversion of control frameworks. The following sample application demonstrates this (see video).
Just try it and give me feedback. Maybe this approach is an interesting topic for a open source project. If you like to work on that topic, drop a mail (email@example.com).
Figure 1: Static and Dynamic Call-Graph Data
Modern enterprise software based on Java EE or Spring Framework is a good sample. In these cases static code analysis gives an overview about the single components (beans), but the dynamic call dependencies are missing. In this situation a developer has either to read a lot of source code or just starts the development environment, setting some breakpoints, debugs and analyses the call dependencies of the running software.
Manual analysis of call dependencies is very time consuming and annoying. This was the motivation for me to combine static and dynamic analysis and write a graphic monitor to view the software in vivo.
The following video gives a impression about the approach:
The Solution consists of two parts (i) a small agent which collects data and (ii) a web client for visualization.