> 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.
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).
> 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.
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
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).