Draw Dependency Graphs
A dependency graph is a directed graph that represents the dependencies of several objects towards each other. There are different flavors of such graphs.
The main question you need to answer is: if I touch this, what else would be impacted?
You can generate these graphs with a pen and a paper. Automated tools may be helpful but are usually cluttered with noise. Don't underestimate the low-tech approach to get started!
Techniques like the Mikado Method leverages such graphs. Concretely, it makes you discover the graph of tasks that needs to be completed before you can achieve your main goal.
🧰 Tools to draw them manually
- Mermaid online editor is really good
- diagrams.code playground is very smooth to use, but can feel more restricted
- Lucidchart might be helpful, although I recommend not spending too much energy in the layout—unless you are creating it for documentation purpose.
🤖 Tools to draw them automatically
- emerge covers many languages—I'm contributing to this one!
- NDepend for .NET developers
- SourceSpy for Java developers (it also allows creating manual diagrams)
- deptrac for PHP developers
- pydeps for Python developers
- rubrowser for Ruby developers
- madge for JavaScript developers
- dependency-cruiser is also a great (and versatile) one for JavaScript developers
- Sapling is useful if you work with React in VS Code
🎓 Related articles
- Safely restructure your codebase with Dependency Graphs
Even drawing them by hand can help you make sense of a tangled codebase! Let's see how they can help, and what tools you can use to generate these.
- Use the Mikado Method to do safe changes in a complex codebase
When a codebase is large and complex, it's risky to big changes. Here's a structured way to approach the problem.
Written by Nicolas Carlo who lives and works in Montreal, Canada 🍁
He founded the Software Crafters Montreal community which cares about building maintainable softwares.