class Base {
virtual int size() { return size_; }
...
class Derived : public Base {
virtual int size() { return rand(); }
...
Here we see an issue. Derived is overriding Base's size method, which has a straightforward implementation, with something wild. If a Derived is sent to a method expecting Base-like behavior, something bad is going to happen.Derived should act like a Base with slightly different implementation details. This is all LSP is. It's a fancy phrase for a very simple concept.