The Liskov Substitution Principle does more than you think

29 pointsposted a month ago
by ulrischa

3 Comments

kazinator

a month ago

> 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

a month ago

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

a month ago

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