In layman's words:
A. O/C principle means that especializationspecialization must be done by extending, not by modifying a class to acommodateaccommodate for especializedspecialized needs.
B. Adding missing ( not especializedspecialized ) functionality means the design was not complete and you have to add it to the base class, obviously without violating the contract. I think this is not violating the principle.
C. Refactoring doesn't violate the principle.
When a design matures, say, after some time in production:
- There should be very little reasons to do so ( point B ), tending to zero over time.
- ( Point C ) will always be possible although more infrecuentinfrequent.
- All new functionality is supposed to be ana specialization, meaning the classes must be extended (inherited from) ( point A ).