Hacker News

The Liskov Substitution Principle does more than you think

29 points by ulrischa ago | 3 comments

kazinator |next [-]

> the subtype passes all black-box tests designed for the supertype

The problem is that it's possible to write black box tests which fail when any extensions are detected in the object, so you can't reduce it to a glibly stated rule like this.

There have to be some blackbox tests that are not allowed.

kazinator |next |previous [-]

Liskov obviously does not only apply when inheritance is involved. It only seems that way from the perspective of very restricted languages in which two types are not substitutable, if they are not linked by a declaration of inheritance (no matter how similar they are otherwise).

tester756 |previous [-]

2026 and people still discuss or argue against SOLID

It only proves that it is bullshit marketing term that somehow made it close enough to be considered as foundational software engineering