GUIDE
The Complete Guide to Dependency Mapping
Dependencies define how software actually works. This guide covers everything: types, mapping techniques, visualization, impact analysis, and practical applications.
Key Insight: You can't safely change code you don't understand. You can't understand code without understanding its dependencies.
What Are Dependencies?
A dependency exists whenever one piece of code relies on another. When function A calls function B, A depends on B. Dependencies are the invisible threads that hold software together—and the threads that cause unexpected breaks.
Types of Dependencies
Call Dependencies
A() { B(); }
Function A calls function B. Most common type. When B's signature changes, A may break.
Import Dependencies
import { x } from './Y'
File X imports from file Y. Changes to what Y exports affect X.
Inheritance Dependencies
class Child extends Parent
Child depends on Parent's structure. Changes cascade down.
Interface Dependencies
Class implements interface. Interface changes require class updates.
Data Dependencies
Function A produces data that function B consumes. Requires data flow analysis.
Package Dependencies
Your code depends on external libraries. Version changes can break everything.
Direct vs Transitive Dependencies
Direct: A directly calls B. You can see this in A's code.
Transitive: A calls B, B calls C. A transitively depends on C, even though A never mentions C. Change C, and A might break.
Most dependency surprises come from transitive dependencies. You change something "isolated" and something "unrelated" breaks. It wasn't unrelated—you just didn't see the chain.
Dependency-Based Impact Analysis
The primary practical use: answering "what breaks if I change this?"
Identify the Change Point. What element are you modifying?
Find Direct Dependents. What directly depends on this? These need review.
Trace Transitive Dependents. Follow the chain outward.
Assess Impact. How many affected? How critical? This is your blast radius.
Good dependency tools automate this. One click shows the entire impact radius.
Dependency Problems to Watch For
Circular Dependencies
A depends on B depends on C depends on A. Creates tight coupling, build issues, testing nightmares. Break the cycle.
God Objects
One element that everything depends on. Change it, break everything. Refactor into smaller pieces.
Hidden Dependencies
Dependencies not visible in code: shared state, configuration, environment. Document or eliminate.
Unused Dependencies
Code nobody calls. Dead weight that still needs maintenance. Identify and delete it.
Dependency Best Practices
Keep dependencies visible
Prefer explicit imports over global access. Visible dependencies are manageable dependencies.
Minimize transitive chains
Shorter chains mean less surprise propagation. Flatten where possible.
Watch dependency count
An element with 50 dependents needs careful handling. High-impact changes require high care.
Layer your architecture
Dependencies should flow in one direction. Layered architecture prevents circular messes.
Review dependency changes
New dependencies in PRs deserve discussion. They shape future architecture.
Regularly audit
Run dependency analysis periodically. Catch problems before they compound.
Map Your Dependencies
LOOM maps every dependency in your codebase. See the connections. Understand the impact. Code with confidence.
Free tier available. No credit card required.