Architecture recovery

Hand-drawn four overlapping rounded terracotta outlines, each broken by gaps, over a dense tangle of fibrous sand, umber, linen and moss pen strokes.

Architecture recovery is the reconstruction of a software system’s architecture, its components and the dependencies between them, from the system’s source code. Comparative studies agree that automatic recovery techniques match expert-built reference architectures poorly (Garcia et al., 2013b; Lutellier et al., 2018). One dispute is how much those comparisons can show, since reference architectures are few and scores depend on the metric (Zhang et al., 2023e). Another is whether large language models (LLMs) do better, since their generated views mostly stay at the level of code (Sathvika et al., 2026). Recovery is one response to architecture erosion, the drift of the implemented architecture away from the intended one, described in Software architecture.

How recovery works and how it is checked

Most recovery techniques group the code’s elements, such as files or classes, into clusters that stand for components. They decide what belongs together from relationships in the code, such as calls, data dependencies and similar names; most techniques merge these relationship types into one (Boerstra et al., 2022). Well-known techniques include ACDC, ARC, Bunch and LIMBO (Zhang et al., 2023e).

A recovered architecture is judged against a ground truth: a reference architecture of the same system that experts built by hand. Ground truths are expensive, so few exist. Building one for a medium-sized project of 70,000 to 280,000 lines takes an experienced person about 100 hours. The ground truth for the Chromium web browser took two years of meetings with its developers (Lutellier et al., 2018). One 2023 evaluation spanned only nine projects with ground truths, and the scarcity of reliable ground truths has long hampered comparisons (Zhang et al., 2023e; Garcia et al., 2013b).

Accuracy metrics and their limits

How accurate a recovered architecture looks depends on the metric chosen. The most common, MoJoFM, counts the moves and joins of elements needed to turn the recovered clusters into the ground truth, and gives the result as a similarity percentage (Boerstra et al., 2022). Other metrics compare whole architectures (a2a) or individual clusters (c2c) (Boerstra et al., 2022).

Each metric has known biases. MoJoFM prefers architectures with many small clusters, so a high score can reflect the number of clusters rather than their quality, and c2c can be unstable (Zhang et al., 2023e). In one comparison, the method that did better on MoJoFM did worse on a2a and c2c in several cases. Its authors conclude that the quality of a recovered architecture depends on the measure used (Boerstra et al., 2022). The same authors note that a system does not necessarily have one correct architecture, and that for some systems the ground truth is simply the existing folder structure (Boerstra et al., 2022).

How accurate clustering tools are

Accuracy is low for every technique compared so far. A 2013 comparison of six techniques against eight independently verified ground truths found that two routinely beat the rest, but that even the best had surprisingly low accuracy (Garcia et al., 2013b). A later comparison found that only ACDC consistently did better than k-means, a basic machine-learning method for grouping data (Lutellier et al., 2018).

The scores in the table come from a 2023 evaluation on nine ground-truth systems; higher MoJoFM means fewer changes are needed to reach the expert’s decomposition (Zhang et al., 2023e). SARIF is the evaluating authors’ own technique.

TechniqueAverage MoJoFM on nine systems
ACDC47%
Bunch-SAHC42%
ARC41%
LIMBO25%
SARIF (authors’ own)61%

Later work still cites these results to state that recovery is not accurate enough for real-world use (Zhang et al., 2023e). A 2026 paper that uses LLMs to refine recovered architectures starts from the same view: architects must still spend significant effort correcting the output of existing tools (Zhang et al., 2026t).

What the input and the system size change Weak evidence: few or small studies support this

Better dependency information improves recovery, but not enough to make it accurate. Techniques produced better architectures from symbol dependencies, which record which functions and variables a file actually uses, than from include dependencies, since a file can include another it does not use (Lutellier et al., 2018). Even with symbol dependencies, overall accuracy stayed low for all techniques (Lutellier et al., 2018).

Only some techniques cope with very large systems. In a scalability study, ACDC, ARC, WCA and Bunch-NAHC were the best adapted; ACDC suits recovery of low-level structure because it produces many small clusters (Lutellier et al., 2018).

Combining several kinds of information Weak evidence: few or small studies support this

Newer techniques combine several kinds of information, with gains that rest on their authors’ own evaluations. One technique that fuses dependencies, code text and folder structure scored 36.1% more accurate on average than the best previous technique, in its authors’ evaluation on nine projects (Zhang et al., 2023e).

How the relationship types are combined matters, with mixed results. A consensus strategy keeps together only elements that every relationship type places in the same cluster. On six systems, it beat the usual merging of relationship types on MoJoFM in all but two experiments (Boerstra et al., 2022).

The consensus strategy has costs and limits. It did worse on Mozilla Firefox, whose ground truth had small clusters that the large consensus groups did not match. It also raised the running time of the Bunch tool by 55.6% on average (Boerstra et al., 2022). The authors state that their results may not generalize beyond the six systems (Boerstra et al., 2022).

Whether recovered architectures help maintenance Weak evidence: few or small studies support this

One study applied three recovery methods to successive versions of Android and Hadoop and asked whether recovery results can measure architectural change (Link et al., 2019). It found that the accuracy of the ACDC and ARC views remained hard to assess, and that none of the three methods supported a full maintenance cycle (Link et al., 2019).

Recovery with large language models

LLMs can identify a system’s broad structure and style, but often describe code and miss finer relationships. In a study of four models, LLMs helped identify structural and stylistic elements but struggled with class relationships and fine-grained design patterns (Santilli et al., 2025). In another, generated architecture views consistently described code rather than architectural abstractions (Sathvika et al., 2026).

Reported accuracy ranges from moderate to high. In the view-generation study, the best custom agent reached about 59% accuracy as rated by humans on 22 repositories. Its authors conclude that LLMs should be assistive tools, not autonomous architects (Sathvika et al., 2026). The authors of the ArchAgent tool report an F1 score of 0.966 for it against 0.860 for DeepWiki, on eight projects whose public architecture documentation served as ground truth (Pan et al., 2026a). F1 combines the share of reported elements that are correct with the share of true elements found, on a scale from 0 to 1.

Where language models fail Weak evidence: few or small studies support this

LLM recovery breaks down on systems too large for the model to read at once, and on dependencies that the code’s imports do not show. Industrial codebases often exceed the context window, the amount of text a model can take in at one time (Pan et al., 2026a). Asked to summarize whole files or packages, LLMs may omit functions, misstate control flow or invent identifiers that do not exist (Pan et al., 2026a).

Hidden dependencies defeat even the best agents. On a benchmark with planted dependencies, the best LLM agents reached a dependency F1 of about 0.67 against 1.0 for a perfect reference, and the weakest models scored below simple rule-based baselines (Sapunov, 2026). About a third of the dependencies could not be found by following imports, and one agent found no data-flow dependencies at all despite reading the code that created them (Sapunov, 2026). The benchmark’s author attributes the failures to the agents’ difficulty in writing down and keeping track of what they have learned about the system, not only to coding skill (Sapunov, 2026).

Further reading

  • Lutellier et al., “Measuring the impact of code dependencies on software architecture recovery techniques” (Lutellier et al., 2018): a comparison of clustering techniques against developer-certified ground truths, including Chromium, and the source for the cost of building ground truths.
  • Garcia, Ivkovic and Medvidovic, “A comparative analysis of software architecture recovery techniques” (Garcia et al., 2013b): an earlier comparison of six techniques on eight verified ground truths.
  • Zhang et al., “Software architecture recovery with information fusion” (Zhang et al., 2023e): scores of earlier techniques on nine systems, a critique of MoJoFM and c2c, and a technique combining several kinds of information.
  • Boerstra, Ahn and Rubin, “Stronger together” (Boerstra et al., 2022): how combining relationship types changes accuracy, and how the answer depends on the metric.
  • Sathvika, Dhar and Vaidhyanathan, “LLM-based automated architecture view generation” (Sathvika et al., 2026): a large evaluation of LLMs and agents generating architecture views from repositories.

Known gaps

What this article cannot tell you yet.

  1. The 2013 comparison of six recovery techniques by Garcia, Ivkovic and Medvidovic is covered only through its summary; its per-technique and per-system scores are not reported here.
  2. Conditions under which a recovered architecture is accurate enough for practical use (system size, language, kind of ground truth) were not established by any of the studies covered.
  3. How language models fare on systems written in several programming languages, and how often their recovered architectures disagree with the system’s own experts, was not researched.
  4. Comparative studies of recovery techniques published after 2023, other than tool authors’ own evaluations, were not covered.
  5. The 2025 study of four language models recovering class diagrams, patterns and styles is covered only through its summary, without its scores.

References

Solid source
Rated highly trustworthy by the research, and every passage taken from it was found in it.
Weak source
Rated low, or a passage taken from it was not found in it.
Medium trust
Rated medium by the research.
Not checked
Rated high, but its passages could not all be checked against it.
Show all 10 references