What is a Source Code Comprehension Tool?

Code Comprehension Tools make it easier to understand and explore existing code bases by providing overviews, cross-references, and visualisations. They assist software engineers during software maintenance, in contrast to tools that help during initial development.

Program comprehension depends largely on the human reader. Some people prefer understanding a program from the bottom-up, whereas others prefer a top-down approach. The Code Comprehension Tools assist the developer in deciding what to read.

Examples of Code Comprehension Tools

  • Jump To Definition: given a variable or function, how is it initialized or defined?

  • Jump To Usage/Show All Uses: Where and how is this variable or function used?

  • Syntax Highlighting: Using typography and colors to distinguish different parts of the program.

  • Outline: Which classes, class members, and other definitions are there in the current scope?

  • Debuggers: Stepping through the program to understand its general flow.

  • Dependency Graphs/Call Graphs: Which functions are called from here? What classes does this component depend on?

  • Autogenerated UML Diagrams: Visualize the (inheritance) relationships between classes.

Are IDEs a kind of Code Comprehension Tool?

IDEs are not only used for initial development but also for maintenance. So yes: Code Comprehension Tools are part of most IDEs. Common tools include: Outlines, Jump To Definition, and Find All Uses.

More sophisticated Code Comprehension Tools like UML generation are often available as IDE plugins, or as standalone applications.

Are Code Comprehension Tools the same as Static Analysis?

Code Comprehension Tools often use Static Analysis techniques, but they are not the same.

Static Analysis has many other uses outside of Code Comprehension, particularly for Quality Assurance and security analysis. Linters, style checkers, and vulnerability scanners are all very valuable, but they don't help directly when reading or exploring a code base.

And Source Comprehension doesn't exclusively use Static Analysis. Dynamic techniques are also extremely valuable to comprehend a code base, for example: stepping through the program in a debugger.

Are Code Comprehension Tools necessary?

Even the best tooling cannot replace the need for a developer's innate Program Comprehension ability. They need to have a rough idea where to look for relevant parts first. But tool support makes it much easier to find those parts:

Code Comprehension Tools generally don't make you more effective at understanding code, but they can make maintenance much more efficient.