Three Principles Behind Volatility-Based Decomposition
Volatility as the primary axis, dependencies that flow from fast to slow, and a build system that enforces it: the three rules behind VBD, in plain language.
"This module is volatile" is the sort of claim everyone nods at and nobody can check. Chapter 3 turns it into something you can compute: a number for each component, a rule about which dependencies are acceptable, and a way to score how well a whole system lines up. It is the point where the intuition becomes an instrument.
The book defines a volatility function that assigns each component a non-negative number: its expected frequency of change, such as changes per month. A higher number means a more volatile component. It then offers four ways of estimating it, in rising order of sophistication:
The first is the one to start with, because your repository has already recorded the answer. For a quick look at a folder, something like this is enough:
git log --since="12 months ago" --oneline -- src/pricing | wc -l
Divide by twelve and you have changes per month. If a pricing folder shows six commits in a year, that is half a change a month. A checkout screen showing forty-eight is four a month, eight times busier. Neither number needs interpreting beyond that.
Raw change counts depend on the project and on the window you measured. To compare components across a system, the book normalises by dividing every value by the largest one observed, so that volatility falls between zero and one. This is why the layer coefficients used from the next chapter onward look the way they do, and why the most volatile layer, the UI, sits at exactly 1.0. They are normalised values, not raw rates.
With numbers in hand, the dependency rule becomes testable. A volatility-compatible ordering is one in which, whenever one component depends on another, the first is at least as volatile as the second. The book then states a theorem that is easy to say in words: for a graph with no cycles, such an ordering exists exactly when every single dependency satisfies that condition. The proof builds the ordering by sorting components from most to least volatile and, within the same level, using an ordinary topological order.
The consequence is pleasantly blunt. Once the graph is acyclic, there is no subtle global property to worry about, just a check on each edge. And if even one dependency points from a calmer component to a busier one, perfect alignment is impossible, which the book records as a corollary.
The direction check is a yes-or-no test. For a finer view the book defines volatility distance: the absolute difference between the volatilities of two components. Averaged over all of a system's dependencies it gives a single alignment score, where lower is better.
The book's reasoning is that an ideal dependency joins components at similar levels, so that change propagates predictably. A dependency across a large gap carries a greater risk of unnecessary change spreading. The chapter illustrates this with a small matrix of distances between four components and the average taken from it.
Two cautions are worth keeping in mind. These are estimates, and a number measured from history describes the past; the book's own advice about volatility reviews, covered in the case-study article, applies here too. And no formula replaces judgment about what a component is for.
You do not need a data-science project to start. Count commits for a dozen components, rank them, and check whether the dependencies between them run from the busy ones to the calm ones. That small exercise turns "volatility" from a feeling into a measurement. The same numbers feed the verification routines described in architecture verification with graphs, and the lvd-metrics tool is presented in lvd-metrics: measuring architectural quality.