---
title: "Lava flow (programming)"
type: "antipattern"
slug: "lava-flow"
url: "http://localhost:3000/en/antipatterns/lava-flow.md"
description: "Issue of incomplete software being deployed"
---
# Lava flow (programming)

> Issue of incomplete software being deployed

In [computer programming](https://en.wikipedia.org/wiki/Computer%5Fprogramming "Computer programming") [jargon](https://en.wikipedia.org/wiki/Jargon "Jargon"), **lava flow** is an [anti-pattern](https://en.wikipedia.org/wiki/Anti-pattern "Anti-pattern") that occurs when computer [source code](https://en.wikipedia.org/wiki/Source%5Fcode "Source code") written under sub-optimal conditions is deployed into a production environment and subsequently expanded upon while still in a developmental state. The term derives from the natural occurrence of lava which, once cooled, solidifies into rock that is difficult to remove. Similarly, such code becomes difficult to refactor or replace due to dependencies that arise over time, necessitating the maintenance of backward compatibility with the original, incomplete design.

## Causes

**Lava flow** can occur due to a variety of reasons within a [software development process](https://en.wikipedia.org/wiki/Software%5Fdevelopment%5Fprocess "Software development process"):

* Pressure to meet deadlines leading to temporary solutions becoming permanent
* Inadequate documentation which prevents understanding of the code’s purpose
* Lack of automated tests which makes refactoring risky
* Frequent changes in the development team leading to loss of knowledge

## Consequences

Unrefined code that becomes part of the software’s infrastructure increases the complexity of the system and the codebase becomes increasingly difficult to understand and maintain. It leads to:

* The need for [backward compatibility](https://en.wikipedia.org/wiki/Backward%5Fcompatibility "Backward compatibility") which can stifle innovation and prevent adoption of newer, more efficient solutions
* Increased [technical debt](https://en.wikipedia.org/wiki/Technical%5Fdebt "Technical debt") that accumulates over time, resulting in higher costs of change and maintenance
* Obstacles to [refactoring](https://en.wikipedia.org/wiki/Refactoring "Refactoring") or improving the system due to fear of breaking dependent components

## Impact on teams

Development teams often experience the impact of **lava flow** when team members cycle in and out:

* Loss of knowledge about aspects of the system's code when original developers leave
* Reluctance among new developers to refactor unfamiliar code, leading to further complexity as they add rather than clean up

## Mitigation strategies

Several practices can mitigate the effects of the **lava flow** anti-pattern:

* Promoting good documentation practices for clear understanding of code
* Encouraging regular [code reviews](https://en.wikipedia.org/wiki/Code%5Freview "Code review") to catch suboptimal practices early
* Prioritizing [refactoring](https://en.wikipedia.org/wiki/Refactoring "Refactoring") as an integral part of the development lifecycle
* Maintaining a comprehensive suite of [automated tests](https://en.wikipedia.org/wiki/Automated%5Ftest "Automated test") to reduce risk in changes
