Best Architecture Analysis Software for Engineering Teams

Dan Greer · · 6 min read

Part of the Tool Comparisons guide. Start with Best Architecture Mapping Software for Developers

Best software architecture analysis tools for engineering teams

Say your domain code imports an HTTP handler. The import resolves, the application builds, the tests you ran pass, and the dependency still violates the boundary your team agreed to keep. Where does that agreement get checked?

That's the question I'd use to choose architecture analysis software. I want a finding I can trace to a rule, or a reason to spend refactoring time in one module before another.

If you need to discover the structure first, start with mapping architecture from code, inspect the modules it reveals, decide which dependencies your team intends to allow, and then return to the rule checks here.

Choose by the question you need answered

For this comparison, conformance means checking implementation against an explicit rule, drift means tracking departures from that agreement as the code changes, and risk analysis helps decide where to investigate or change code first. Those jobs need different evidence.

Your question Tool to evaluate Evidence to inspect
Does Java code obey our package and layer rules? ArchUnit Architecture test violations from Java bytecode
Can we check project-specific relationships in a graph? jQAssistant Cypher constraints over scanned artifacts
Does an import cross a forbidden boundary? dependency-cruiser Dependency violations against configured rules
Does implementation match our intended architecture model? Sonargraph Violations of architecture rules defined in its DSL
Where should we spend refactoring effort? CodeScene Hotspots considered alongside Code Health
Which callers and endpoints could a change affect? Pharaoh (ours) Repository relationships returned through MCP

I build Pharaoh. Its place here is investigating change impact in TypeScript, JavaScript, Python, C and C++ repositories, alongside tools that enforce your architecture rules.

Put an architecture rule in the repository

dependency-cruiser works with JavaScript and TypeScript, checks dependencies against your rules, provides a configuration initializer, and documents installation in its README, so you can start with the project settings it generates.

npm install --save-dev dependency-cruiser
npx dependency-cruiser --init

npx runs the configuration initializer in the second command. Keep the generated project settings, including the resolver settings appropriate to your project, then add the following entry to the configuration's forbidden array, changing the paths to match your folders.

{
  name: 'domain-must-not-import-transport',
  severity: 'error',
  from: { path: '^src/domain/' },
  to: { path: '^src/transport/' }
}

This is an illustrative policy for a hypothetical repository. It says domain files must not depend directly on transport files.

The rules reference defines these fields. The from.path field selects the importing modules, to.path selects the dependency targets, and the rule names the forbidden direction, so an import going the other way isn't prohibited by this rule.

npx dependency-cruiser src

npx runs the analysis over src here. dependency-cruiser reports configured violations, gives error-level violations a nonzero exit status with the error reporter, and can therefore supply a CI check, provided you've configured the project correctly, which the deliberate violation below helps you check.

dependency-cruiser should catch a forbidden import on a disposable branch, name the expected files, stop reporting it after you remove that import, and accept an allowed import. Check that before trusting the configuration.

dependency-cruiser's initializer also writes preset rules into forbidden. Its README lists circular dependencies, dependencies missing from package.json, orphans, and production code relying on dev or optional dependencies. In the initializer template, the cycle rule, no-circular (built on to.circular), is only a warning, while presets such as not-to-unresolvable and not-to-dev-dep are errors that can fail a run on their own. I'd still start the conversation with the boundary your team already agrees on, and review the presets and their severities deliberately so the first discussion isn't an argument about a rule set nobody chose.

dependency-cruiser needs imports resolved as intended. If an alias doesn't resolve to the file you expect, fix the project configuration before interpreting a clean result.

Java rules, graph constraints and architecture models

ArchUnit fits architecture tests in Java

ArchUnit analyzes Java bytecode. You can assert package dependencies and layer boundaries, check for cycles, import the classes you want to cover, and run those rules through a Java test framework.

I'd evaluate it when the team can state a dependency rule in code and wants that rule reviewed with the rest of the tests.

Existing violations don't have to make adoption all-or-nothing. ArchUnit's FreezingArchRule records current violations, reports new ones on later runs, and reduces the recorded set as violations get fixed, so a team can prevent additional drift while working through the old findings.

Keep that baseline visible. By default the store is plain text files you can commit, and ArchUnit won't create a new one unless freeze.store.default.allowStoreCreation=true is set in archunit.properties, so allow it for the first recording run, and leave it off in CI. A passing frozen rule means no violation outside the recorded baseline was found; the recorded ones are still accepted.

jQAssistant fits rules over a project graph

With jQAssistant, scanned artifacts go into Neo4j, rules use Cypher, concepts enrich the graph, and constraints identify violations. That gives you room to express project relationships beyond a pair of directory patterns.

For example, you could define which scanned elements belong to your domain layer and write a constraint for a forbidden dependency. That is a proposed rule to implement, not a captured result.

I'd budget time for the model as well as the query. Decide which artifacts to scan, define the concepts the rule needs, inspect the resulting relationships, and verify a known violation before adding the constraint to the build.

Sonargraph fits an intended architecture model

For an explicit model, Sonargraph provides an architecture DSL, Architect supplies the desktop environment, and Build runs checks on a build server, where quality-model violations can fail the build.

I'd bring Sonargraph a boundary the team already maintains. Its getting-started guide describes defining architectures and verifying that implementation matches them. Configure the system, model the allowed dependencies, introduce a known violation, and check that someone unfamiliar with the model can follow the report back to the code.

Use hotspots to choose where to work

CodeScene's hotspot analysis identifies code where development activity is concentrated. Consider that alongside Code Health, compare a frequently changed area with a stable one, and use the combination when choosing the next maintenance task, keeping your team's actual work in view.

That's a different decision from enforcing an import rule.

CodeScene also supports architectural analyses. Configure Architectural Components to group files, then inspect hotspots at that level, review change coupling between components, and check whether the grouping matches the boundaries your team cares about. Its change coupling guide counts modules as coupled when they're modified in the same commit, by the same programmer within a set period, or under the same ticket ID, and says coupling in itself is neither good nor bad. I'd use that as a reason to investigate a relationship. A co-change finding alone doesn't establish that a particular import violates your architecture policy.

Check change impact before repairing a violation

Once you find a forbidden dependency, you still need to decide how to remove it. Pharaoh maps repository structure into a code knowledge graph and makes it available through MCP. Use get_module_context to inspect a module's imports and external callers, then get_blast_radius for the function you plan to change, review the affected production callers, and inspect the endpoints in the result. Test-file callers are excluded from blast-radius results, so choose and inspect tests separately.

Here is an unchanged dependency excerpt from get_module_context, captured for the features/auth module, at revision 54343aa6 of the public Pharaoh-so/cal.diy repository, showing all 16 modules it imports from.

## Dependencies

### Imports from:
- app-store/_utils (weight: 2)
- app-store/googlecalendar (weight: 1)
- dayjs (weight: 3)
- emails (weight: 2)
- features/credentials (weight: 2)
- features/flags (weight: 2)
- features/membership (weight: 1)
- features/profile (weight: 6)
- features/users (weight: 4)
- features/watchlist (weight: 2)
- i18n (weight: 4)
- lib (weight: 34)
- lib/auth (weight: 2)
- lib/server (weight: 6)
- prisma (weight: 16)
- prisma/client (weight: 1)

That gives a reviewer specific module dependencies to inspect while planning the repair. The separate guides cover tracing a change's blast radius and planning a change from its impact. The revision matters. Pharaoh's graph covers the default branch, a live repository re-maps after pushes to that branch, and uncommitted edits aren't in that graph, so run the architecture rule against your working branch after making the repair.

If you want that context in your coding session, connect Pharaoh to your repository, install the GitHub App on the account or org that owns the repository, then connect your AI client, and sign in with GitHub.

Make the trial catch something you already understand

I'd finish a tool trial with a small reviewable result. Pick an agreed boundary, show that a deliberate violation is detected, show that an allowed dependency passes, and record which files the analysis covered so the next person can repeat it.

For a hotspot trial, choose a module with maintenance history you can inspect and compare the ranking with that history. Write down where the finding changes your refactoring plan.

Then keep the rule or finding with the proposed repair. The next review should have a specific dependency to discuss.

More in Tool Comparisons

← Back to blog