What is call graph?

Definition

A call graph represents functions as nodes and function calls as directed links. Developers use it to trace how a request reaches part of an application or to identify callers affected by a change.

Graphs built from source approximate possible paths. Runtime traces can show the paths taken during a particular execution, and tests can verify that those paths produce the expected behavior.

ELI5

Imagine a map showing which people hand a form to the next desk.

A call graph does that for software functions. You can follow the route from a button press to the code that handles the request.

How is a call graph useful for a code review?

It can identify functions that depend on the code being edited and help reviewers choose relevant tests.

Can a graph prove a permission check works?

A graph shows relationships. Inspecting the conditions and testing allowed and denied requests verifies the behavior.

  1. Blue and white “FIND THE MISSING CHECK” headline beneath a broken link between person and document glyphs on black.
Definition card for call graph: What is call graph?

A map of which functions or methods can call one another.