title: Should I unittest private/protected method
body: <p>This is actually language agnostic. But I'll give you context in python.</p>
  
  <p>I have this parent class</p>
  
  <pre><code>class Mammal(object):
      def __init__(self):
          """ do some work """
  
      def eat(self, food):
          """Eat the food"""
          way_to_eat = self._eating_method()
          self._consume(food)
  
      def _eating_method(self):
          """Template method"""
  
      def _consume(self, food):
          """Template method"""
  </code></pre>
  
  <p>Here <code>eat</code> is the only public method whereas <code>_consume</code> and <code>_eating_method</code> are actually protected methods which will be implemented by child classes.</p>
  
  <p><em>What will you test when you have written only the <code>Mammal</code> class?</em></p>
  
  <p>Obviously all 4 methods.</p>
  
  <p>Now let's introduce a child</p>
  
  <pre><code>class Tiger(Mammal):    
      def _eating_method(self):
          """Template method"""
  
      def _consume(self, food):
          """Template method"""
  </code></pre>
  
  <p>Look at this class. It has only 2 <em>protected</em> methods.</p>
  
  <p><em>Should I test all 4 methods of <code>Tiger</code> (including 2 inherited) or just test the changes introduced (only overrided 2 methods)?</em></p>
  
  <p><strong>What is the ideal case?</strong></p>