title: How to protect a base class from causing errors in its subclasses?
body: <p>One of the disadvantages of inheritance is that the superclass and its subclasses are very tightly coupled. A lot of resources (e.g. SO) say to compensate for this by being 'cautious' when writing a class that might be subclassed.</p>
  
  <p>Are there any guidelines about what precautions you should take, or testing processes to go through to make sure your base class is safe? Or do you just have to try to predict all potential subclass behavior?</p>