BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage Articles Avoiding Technical Bankruptcy: a Whole-Organization Perspective on Technical Debt

Avoiding Technical Bankruptcy: a Whole-Organization Perspective on Technical Debt

Bookmarks

Key Takeaways

  • The technical debt metaphor was conceived to describe a process of deliberately going into production early with known limitations in order to learn about the problem we’re solving. However, the meaning of the metaphor has been diluted to the point where most of what is labelled "technical debt" is incurred inadvertently, and hence with no strategy or plan to pay it off.  
  • Inadvertent "technical debt" is the by-product of a dysfunctional software development process, which starts with poor communication.
  • Poor communication leaves organizational issues such as conflicts of interests unhandled, and leads to inadequate clarification of the problem to solve. This hinders our ability to develop a suitable mental model of the problem, which ultimately manifests itself in complex code that we label "technical debt".
  • Focusing on the symptoms ("technical debt") of a dysfunctional development process instead of the underlying causes is inefficient since the broken process will produce new problems faster than the development team can address the old ones.
  • The problem is framed as "technical" because the consequences manifest in code and because it is more comfortable for everyone if it is confined to code. However, framing it as something that "the developers" can "clean up" contributes to the broken development process by deepening the divide between "the business" and "the developers", a divide that must be bridged if we hope to fix the process and ultimately the problem of rampant "technical debt".

As software systems evolve, they tend to become less flexible and more difficult to work with. We often attribute this to rampant "technical debt", but fail to talk about what causes it.

Technical debt is not primarily caused by clumsy programming, and hence we cannot hope to fix it by more skilled programming alone. Rather, technical debt is a third-order effect of poor communication. It is a symptom of an underlying lack of appropriate abstractions, which in turn stems from insufficient modelling of the problem domain. This means that adequate communication has not taken place; discussions and decisions to resolve ambiguity and make informed trade-offs have been swept under the rug.

What we observe and label "technical debt" is the by-product of this dysfunctional process: the reification of this lack of resolution in code. To fix the problem of accumulating technical debt, we need to fix this broken process.

Main causes of technical debt

The technical debt metaphor was introduced by Ward Cunningham to describe a process where developers make a conscious decision to ship code with known limitations into production. The purpose of shipping early is two-fold: to get quickly to market and to enable a feedback loop from production back to further development and refinement. It quickly caught on, since it allowed developers to communicate "invisible" problems with the technical solutions to management and other stakeholders.

In the process of becoming widespread and popular, however, the meaning of the technical debt metaphor has also become diluted. Any code running in production that has limitations or quality problems may find itself labelled as technical debt. This is unfortunate, since it undermines the usefulness and the richness of the metaphor. Much of what is considered technical debt is incurred inadvertently over time, and with no clear strategy for paying it off.

Technical bankruptcy

It is regrettable that the meaning of the technical debt metaphor has been diluted in this way, but in language as in life in general, pragmatics trump intentions. This is where we are: what counts as "technical debt" is largely just the by-product of normal software development. Of course, no-one wants code problems to accumulate in this way, so the question becomes: why do we seem to incur so much inadvertent technical debt? What is it about the way we do software development that leads to this unwanted result?

These questions are important, since if we can go into technical debt, then it follows that we can become technically insolvent and go technically bankrupt. In fact, this is exactly what seems to be happening to many software development efforts. Ward Cunningham notes that "entire engineering organizations can be brought to a stand-still under the debt load of an unconsolidated implementation". That stand-still is technical bankruptcy. It means that your organization can no longer move forward.

Reasonable changes to the software take an unreasonable amount of time to implement. Quality problems become permanent; you can't fix bugs without a very high chance of introducing new ones, leading to a sort of oscillation between problems.

Technical debt in practice

If we are to understand the forces that drive the accumulation of inadvertent technical debt, we must look at the code and see how "technical debt" manifests itself.

My observation is that there tends to be a lot of ifs and buts, and little to communicate intent and aid understanding. By that I mean literally that there are many if and else branches in the code, and a great number of boolean flags to control execution flow between those branches. What’s missing are useful abstractions and boundaries to make sense of it all. This makes it difficult to isolate the code related to a single feature, since the code for that feature isn’t isolated in any meaningful or obvious sense. It is difficult to predict the effects of changes, since changing a single boolean flag can have rippling effects throughout the codebase.

Code ends up like this when we have an underdeveloped, inadequate mental model of the problem we’re trying to solve with software. Software’s dirty secret is that we can implement solutions to problems we can’t articulate clearly. If our software is "wrong", the correct behavior is always only an if-branch away. We just need a way to inject the right flag so that we can take the correct turn in the flow of execution instead of the wrong one. We can and do compensate for our poor domain models by using if-branches as epicycles. But this is exactly the cause of our problem with inadvertent technical debt: over time, we paint ourselves into a corner. It leads to incomprehensible software - technical bankruptcy.

We can no longer add functionality this way without breaking existing functionality.

Fix the model, not the code

It's very hard to write simple and precise code if we don't have the proper concepts in our heads. We need those concepts not only to structure our solution, but to think clearly about the problem in the first place. As long as we lack the proper concepts, both our thinking and our communication with others will be clumsy and roundabout. Imagine trying to tell someone a story about a dog without knowing the word dog or even the word animal. "It's one of those eager, four-legged living things that wag their tails". It sounds silly, but I've been in that situation many times on projects.

On one project I was on, we struggled with our credit card module. The code was complex and difficult to understand, and we had very inefficient and frustrating discussions whenever we talked about that module, but we couldn't really figure out why. It wasn't until we realized that we lacked a concept to describe how credit cards were associated with credit card deals (an "association mechanism"), that everything fell into place. Suddenly our heads cleared up, our discussions cleared up, and it was possible to implement very straightforwardly. We deleted all the clumsy code we had written up to that point, and replaced it with something that was trivial to understand.

This experience points toward a heuristic for tackling complex code - code that tends to get labelled "technical debt" after a while: look for missing or awkward concepts. Look for patterns of frustration in the design discussions in the team. It’s probably the domain trying to tell you something. Trying to "fix" the code without the right concepts is likely to fail, since there is no elegant or clean organization of the wrong concepts.

I want to argue that our problems stem from an underdeveloped, inadequate mental model of the problem we're trying to solve with software. For software that is developed as group efforts, which is most software, that mental model needs to be shared among the people working on the software. Otherwise, it's no wonder that inconsistencies and corner cases come to bite us. If we’re not aligned on what the problem and the proposed solution is, then we should expect to see the consequences of those failures of alignment manifest themselves in the code. And we do.

The key to developing a sufficiently rich and flexible shared mental model is communication and collaboration. When software is weighed down by technical debt, that's a symptom that the organization developing the software probably needs to look at its communication and collaboration patterns.

The divide between business and IT

Ward Cunningham invented the technical debt metaphor to enable developers to communicate to business people something that is visible to the former, but hidden from the latter; that while we shipped code now that meets the business requirement, we overstretched in doing so. Having done so has left us off-balance, and we need to spend some time regaining our balance. Otherwise we will eventually fall down and it's going to be hard to get up. But in a sense, that's an easy problem to fix: generously give the developers a bit of time every now and then to clean up in their own house, so to speak. All that's required from the business people is a little patience while the developers catch up.

Unfortunately, I don’t think it’s going to work. If I'm right that much of what we label technical debt really stems from inadequate modelling of the business domain and ultimately is caused by communication and collaboration issues, it's not a problem that developers can solve on their own. In fact, thinking that the developers can and should handle technical debt alone is a symptom of the kind of thinking that leads to technical debt. That’s an uncomfortable insight for both developers and business people. It is convenient for business people to think of technical debt as something for IT to handle, and it is more comfortable for developers to think that all they need is a little time to get things right. But it’s a convenience and a comfort that we cannot afford if we’re going to address the root causes of technical debt.

Reducing technical debt

The main problem for a software organization that finds itself close to technical bankruptcy is not the amount of debt itself, but rather that the organization in its current state produces unmanageable amounts of complex code inadvertently. There is little to be gained by chipping away at the incurred debt if we continue to produce new debt at the same rate as before. It can be very costly, time-consuming and risky to try to untangle code that is near bankruptcy. It is often better to find some way of replacing debt-heavy code with other code that has been produced in a healthier way. The best advice I can give is to try to incur less debt than we currently do, that is, reduce the amount of technical debt we have to reduce in the first place.

Over time, the best approach to reducing what we label "technical debt" is by addressing the root cause, which is how we work together. It can be difficult to change the culture of a software organization. Top-down initiatives will often struggle, since they fail to address the problems seen on the ground. Perhaps the best top-down initiative is to give leeway and autonomy to those on the bottom, since I believe it is possible to bring about positive change bottom-up.

My experience has been that doing software development as a group (i.e. ensemble programming) not only produces better designed solutions to problems quicker, but also creates a cultural shift towards more open, empathic and candid communication. This in turn means that teams doing ensemble programming are less likely to find themselves bogged-down in technical debt as time moves on. Moreover, having experienced improved communication within the team, ensembles are less likely to settle for poor communication across team boundaries as well, or between people with different roles in the organization. If this is true, then working in ensembles can have a positive rippling effect on the communication patterns of the organization.

Conclusion

The uncontrolled accumulation of inadvertently incurred technical debt is endemic in the software industry. The underlying cause for this tendency is that our communication patterns are inadequate. This leads to underdeveloped mental models, and developers approximating solutions to poorly articulated and understood problems by heaping on boolean flags and branching control flows.

Over time, software built this way becomes incomprehensible. The way to break this tendency is to change the way we build software: by collaborating and communicating better. Working in ensembles can be a step in the right direction, since it places collaboration and communication at the core of software development.

About the Author

Einar W. Høst is a software developer at NRK, the Norwegian public broadcaster, where he helps build the TV streaming service. His main interests are domain modelling, API design and computer programming. He has a PhD in Computer Science from the University of Oslo. You can find him on Twitter as @einarwh or read his blog.

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

  • "epicycles"?

    by H. Mijail Antón Quiles,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    "using if-branches as epicycles" - sounds like some autocorrect misfire happened here...

  • Re: "epicycles"?

    by Einar Høst,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Hi,

    The word "epicycles" is deliberate here. I mean that layers of if-branches controlled by boolean flags can be used to obtain correct behavior from a poor model of the problem in code, in the same way that layers of epicycles were used to obtain correct planetary movements in the geocentric view of the universe. If the observed behavior in a particular scenario is wrong, it can always be "patched" to be correct for that scenario. This is why I mean that if-branches can act as epicycles. The underlying point I want to make is that a poor model spawns complexity that could be avoided with a better model.

  • How is tech debt related to the process

    by Rusi Popov,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    This article presents a good analysis on the causes of the tech debt, but I would suggest the authors to elaborate more in that direction. Of course, building and clarifying the domain model with the business is the base for paying that debt, but what are the reasons to start coding without any model and then going in production? How did it happen to build a long term business with not communicated domain model and knowledge, especially when people who supportit come and go? How did it happen that a POC / prototype became a product?
    Hint: verba volent

  • Re: How is tech debt related to the process

    by Einar Høst,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Thanks for the comment! I agree, there are many things in the article that could and should be elaborated further. We need a much better understanding of the forces and mechanics that produce "technical debt" if we are to tackle the problem effectively. There are wide areas of study that can be useful to us in this regard, such as organization theory, systems thinking and psychology. With respect to your hint, I think there are at least two (very different!) interpretations that are both relevant. First, "talk is cheap", and ambiguities can easily hide and even thrive in natural language, as we silently shift and slide the meaning of our words, sometimes not even consciously. Unfortunately, when we write down things in code, we don't always write down disambiguated agreements (as in a contract or a specification), but just as often our one-sided assumptions and bets about the future. Second, talk is instantaneous, whereas anything that is written down has inertia. If I change my mental model of the domain, I can immediately start talking in terms of the new model, but all the code written by myself and others will lag behind and require diligent and costly work to update. Another metaphor for "technical debt" could be the sediments accumulated from the different mental models the different developers have had over the years. To some extent, this is unavoidable: when there is more than one developer working on a software product, there will always by slight variations of the mental model at play, and these will all be reflected in the code. The best we can do is to try to counter that tendency by communicating well and being as explicit as we can. Of course, there are many ways in which unhealthy management can make that tendency worse instead, e.g. by rewarding behavior that have local, short-term benefits but cause problems for the whole system in the long term.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT