Leaky abstraction


In software development, a leaky abstraction is an abstraction that leaks details that it is supposed to abstract away.
As coined by Joel Spolsky, the Law of Leaky Abstractions states:
This statement highlights a particularly problematic cause of software defects: the reliance of the software developer on an abstraction's infallibility.
Spolsky's article gives examples of an abstraction that works most of the time, but where a detail of the underlying complexity cannot be ignored, thus leaking complexity out of the abstraction back into the software that uses the abstraction.

History

The term "leaky abstraction" was popularized in 2002 by Joel Spolsky. An earlier paper by Kiczales describes some of the issues with imperfect abstractions and presents a potential solution to the problem by allowing for the customization of the abstraction itself.

Effect on software development

As systems become more complex, software developers must rely upon more abstractions. Each abstraction tries to hide complexity, letting a developer write software that "handles" the many variations of modern computing.
However, this law claims that developers of reliable software must learn the abstraction's underlying details anyway.

Examples

Spolsky's cites many examples of leaky abstractions that create problems for software development:
Git's interface is another example for leaky abstraction as explained in this article.