A SOLID design principle. All subtypes must be substitutable for their base types. This means that the validity of a model, viewed in isolated cannot be meaningfully validated.

Formal Definition

  • With be a property provable about objects of type
  • Then, should be true for all objects of type where is a subtype of

“If it looks like a duck, quacks like a duck, but needs batteries - you probably have the wrong abstraction”

Examples

Counter Example